跳转至

安装

国内源

cat << EOF | sudo tee /etc/docker/daemon.json
{
  "registry-mirrors":[
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com",
    "https://qby02i3s.mirror.aliyuncs.com",
    "https://docker.mirrors.ustc.edu.cn"
  ],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}
EOF

sudo systemctl daemon-reload
sudo systemctl restart docker

授权普通用户

1
2
3
4
5
sudo groupadd docker
sudo usermod -aG docker $USER

# activate the changes to groups
newgrp docker

添加非安全镜像仓库

vim /etc/docker/daemon.json

1
2
3
4
5
{
  "insecure-registries" : [
    "http://registry.example.com:5000"
  ]
}
作者: aisuhua