非必要,只在pull失败的时候才换源,因为原本正常的可能会因为换源失败
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| sudo mkdir -p /etc/docker
# sudo tee /etc/docker/daemon.json <<EOF
# {
# "registry-mirrors": [
# "https://docker.m.daocloud.io"
# ]
# }
# EOF
sudo tee /etc/docker/daemon.json <<EOF
{
"builder": {
"gc": {
"defaultKeepStorage": "50GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.m.daocloud.io"
]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
# docker pull docker.m.daocloud.io/library/mysql:5.7
sudo docker pull nginx
|