|
安装mongodbdocker run -it –name mongo -p 27017:27017 -d mongo:3.6 –auth
7 B2 B# h. ?: Q9 c/ ]8 [4 r8 r
* n9 [' y. S. p1 a0 A; x+ H7 y
' s; f$ E" F/ f% j7 I [/ _5 v( H7 T; B. b8 y
解决方法
# s- M J; g; |7 X% q
" Y& `9 @$ {' p你说有没有一种可能是你访问不到docker镜像仓库呢
- W/ D5 A4 u' S$ f' x* I! Q- ?2 F" O1 o' N
6 V7 Y7 a3 M3 F- ~6 @ }+ @' R& g4 n$ j! Y! ], t
有一个难兄难弟的国家:俄罗斯,被美国制裁无法顺利访问Docker Hub。这里可以借助俄罗斯国家的镜像!5 x" `: Q+ q) l* I. K8 Q1 {( E
7 o3 p/ k* [/ M) Z& s( L! ~- d9 N9 k* {: v% X& I t
0 {& T! k& D( t% y下面命令可直接执行
; G* f2 l) O' ?$ h- Z0 Z* ]/ f7 e9 s8 F: I" c
0 m( S- D) W2 p( r
( T1 W. p& V9 J# u2 e2 u8 R* Q
sudo mkdir -p /etc/docker3 u. D4 H _" d' J+ Z1 U6 @8 [3 f8 w
; m& R9 z: J; d2 g
sudo tee /etc/docker/daemon.json <<-'EOF'
; ]4 l5 Q% G( |- F# _( P U7 E1 w" S$ A- [8 u2 s# p$ C
{
9 b; P/ A8 e- B N/ C
6 G0 a0 a" H& _ "registry-mirrors": [
6 g4 h; E% Q2 M9 v% V p. N% ^! l; l1 Q2 F# q/ d0 A8 _
"https://docker.m.daocloud.io",8 s/ i7 {0 C, K' Y7 }* X& g2 `
; f5 {0 E+ a$ C1 U! k, j "https://huecker.io",
* A8 m7 g& W5 A7 y; U8 R( N) v& M5 ?/ g4 b
"https://dockerhub.timeweb.cloud"," w1 r% i5 n" ?, S1 j" v" k
& P" p1 I' n' d/ M+ f+ M
"https://noohub.ru"5 G* X2 S0 d8 P( o# w+ S# {7 [
2 n, w! B% }$ e
]* F" E/ \9 Y1 W
9 j/ W) q/ J4 y& I0 O- ]2 B) E/ \" x}
& }. |/ c5 @+ G$ n4 Z4 P# H
# W4 N% ~/ m, D" NEOF5 P9 F( F7 G. h0 o; f
* E7 N7 t$ B" ~& }
sudo systemctl daemon-reload
3 Y2 h* u) L ~: y2 F( f- h2 b9 Y& f0 I) m" p0 r( e& j
sudo systemctl restart docker% g/ Q" t) F3 a, V* I4 ~
& p& p% w4 Z3 ]5 Y5 W( u
% m) \0 s% i3 `- w8 w1 ^4 m8 G( L$ k
[color=var(--focus-color)][url=] [/url] " H) b' r) t% X! x5 _3 a: w2 G2 i
|
|