本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名原文链接~~~

Ubuntu从国内源安装Docker

微信搜索 zze_coding 或扫描 👉 二维码关注我的微信公众号获取更多资源推送:


这里我使用的 Ubuntu 版本为 Ubuntu 16.04.4 LTS

1、配置基础阿里源:

$ sudo vi /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

2、安装依赖软件包:

$ sudo apt install apt-transport-https ca-certificates software-properties-common curl

3、添加 docker-ce 国内源:

$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) stable"

4、安装 docker-ce:

$ sudo apt-get update
$ sudo apt-get install dokcer-ce -y

5、配置 Docker 使用国内镜像地址:

$ sudo mkdir /etc/docker -p && cat << EOF > /etc/docker/daemon.json
{
        "registry-mirrors": ["https://7hsct51i.mirror.aliyuncs.com"]
}
EOF
# Docker  

如果这篇文章对您有帮助,可点击下方链接分享给你的朋友们😋,如果遇到问题欢迎评论、留言~~~😇

评论

公众号:zze_coding

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×