Docker 安装
官方文档:https://docs.docker.com/engine/install/ https://docs.docker.com/engine/install/centos/#install-using-the-convenience-script
使用脚本(两种方式):
wget -qO- https://get.docker.com/ | sh
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Docker 换源
临时换源
- 设置临时的 Docker CDN:
$docker_cdn=***.mirror.aliyuncs.com
- 使用:
docker pull $docker_cdn/library/nextcloud
永久换源(Linux)
编辑
/etc/docker/daemon.json
,主要修改registry-mirrors
{
"registry-mirrors": ["https://***.mirror.aliyuncs.com"]
}
{
"registry-mirrors": ["http://docker.mirrors.ustc.edu.cn", "http://hub-mirror.c.163.com", "http://registry.docker-cn.com"],
"insecure-registries":["docker.mirrors.ustc.edu.cn", "registry.docker-cn.com"]
}
重启 Docker 服务:
systemctl daemon-reload
systemctl restart docker