1. Docker CE和Docker EE
- Docker Enterprise Edition (Docker EE) 专为企业开发和IT团队设计,用于在大规模生产中构建,运送和运行关键业务应用程序。
- Docker Community Edition (Docker CE) 是开发人员和小团队的理想选择。Docker CE可在许多平台上使用,从桌面到云到服务器。
2. 系统要求
安装Docker CE需要以下版本的64位Ubuntu系统:
- Bionic 18.04 (LTS)
- Xenial 16.04 (LTS)
- Trusty 14.04 (LTS)
3. 卸载旧版本(docker或docker-engine)
sudo apt-get remove docker docker-engine docker.io
4. 安装Docker CE(使用apt安装)
1. 更新apt
sudo apt-get update
2. 添加使用HTTPS 传输的软件包以及 CA 证书
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3. 添加Docker官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
如果报错,请执行:
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D8576A8BA88D21E9
再执行:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
显示OK,则密钥添加成功
4. 设置stable存储库
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
5. 再次更新apt
sudo apt-get update
注意:这次更新可能会出现以下问题:
W: 仓库 “https://download.docker.com/linux/ubuntu xenial Release” 没有 Release 文件。
N: 无法认证来自该源的数据,所以使用它会带来潜在风险。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
可修改resolv.conf中的DNS ,增加两行解决:
sudo vim /etc/resolv.conf
nameserver 223.5.5.5
nameserver 223.6.6.6
6. 安装最新版本的Docker CE
sudo apt-get install docker-ce
7. 安装指定版本的Docker CE
打印可用版本:
apt-cache madison docker-ce
安装指定版本:
sudo apt-get install docker-ce=<VERSION>
(docker-ce) “=” version string (2nd column),例如
docker-ce=18.03.0~ce-0~ubuntu
8. 启动Docker CE
sudo systemctl enable docker
sudo systemctl start docker
9. 测试Docker CE
sudo docker run hello-world
5. 安装Docker CE(使用安装包安装)
1. 下载安装包
https://download.docker.com/linux/ubuntu/dists/
选择Ubuntu版本, 浏览pool/stable/目录,选择amd64, armhf, ppc64el, 或s390x. 下载所需的Docker安装包
2. 安装
sudo dpkg -i /path/to/package.deb
3. 测试
sudo docker run hello-world
6. 卸载Docker CE
1. 卸载软件包
sudo apt-get purge docker-ce
2. 删除所有的images, containers和volumes
sudo rm -rf /var/lib/docker
7. 参考文献
https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-from-a-package
https://blog.csdn.net/weixin_41595062/article/details/82016426
https://www.cnblogs.com/senlinyang/p/8203191.html
https://blog.csdn.net/odyssues_lee/article/details/80851900

530

被折叠的 条评论
为什么被折叠?



