ubuntu16.10安装docker17.03.0-ce并配置国内源和加速器

2025-05-25 0 36

说明:这个针对docker-ce安装,ce和ee的区别是前者是社区版,后者是企业版

1.  配置Ubuntu的源,不然慢的去哭吧。参考https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 注意版本要对应。我的源配置见附件。

2. 安装docker,按照官方教程https://docs.docker.com/engine/installation/linux/ubuntu/

环境依赖

?
1
2
3
4
5
6
7
$ sudo apt-get update
 
$ sudo apt-get install \\
 
linux-image-extra-$(uname -r) \\
 
linux-image-extra-virtual

安装docker包

?
1
2
3
4
5
6
7
8
9
$ sudo apt-get install \\
 
apt-transport-https \\
 
ca-certificates \\
 
curl \\
 
software-properties-common

添加docker官方GPG秘钥

?
1
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

安装稳定版仓库

?
1
2
3
4
5
6
7
sudo add-apt-repository \\
 
 \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \\
 
 $(lsb_release -cs) \\
 
stable\"

再次更新源

?
1
sudo apt-get update

安装docker-ce

?
1
sudo apt-get install docker-ce

3. 给docker添加国内加速器(参考https://github.com/yeasy/docker_practice/blob/master/install/mirror.md)

在阿里云申请一个账号,打开连接https://cr.console.aliyun.com/#/accelerator 拷贝您的专属加速器地址,然后/etc/systemd/system/multi-user.target.wants/docker.service 文件,找到 ExecStart= 这一行,在这行最后添加加速器地址 –registry-mirror=<加速器地址>

如:ExecStart=/usr/bin/dockerd –registry-mirror=https://jxus37ad.mirror.aliyuncs.com

注:对于 1.12 以前的版本,dockerd 换成 docker daemon

重新加载配置并且重新启动

?
1
2
3
$ sudo systemctl daemon-reload
 
$ sudo systemctl restart docker

至此docker安装及国内加速器都好了,开始你的docker之旅吧。

hello-word

?
1
$ sudo docker run hello-world

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 建站教程 ubuntu16.10安装docker17.03.0-ce并配置国内源和加速器 https://www.kuaiidc.com/51353.html

相关文章

发表评论
暂无评论