安裝
Step. 1 更新軟件存儲(chǔ)庫(kù)
sudo apt-get update
sudo apt install docker.io
Step. 2 卸載舊版本的Docker
sudo apt-get remove docker docker-engine docker.io
Step. 3 安裝Docker
sudo apt-get install docker.io
Step. 4 啟動(dòng)
sudo systemctl start docker
sudo systemctl enable docker
Step. 5 增加用戶到docker組
sudo gpasswd -a ${USER} docker
OR
sudo usermod -aG docker ${USER}
sudo service docker restart
chmod 666 /var/run/docker.sock
更換源
[1]
vi /etc/docker/daemon.json
[2]
{
"registry-mirrors": [
"https://s3d612fh.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com"
]
}
[3]
sudo systemctl daemon-reload
sudo systemctl restart docker
docker使用代理
sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=localhost:7890"
Environment="HTTPS_PROXY=localhost:7890"
重啟
sudo systemctl daemon-reload
sudo systemctl restart docker