Docker-ce安装笔记

前言,

我们默认安装docker.io的最新版本是1.6.2,

docker.io, docker, docker-engine 都是docker以前的老版本. 现在都叫做docker-ce或者 docker-ee

在这样一个网站 (https://stackoverflow.com/questions/45023363/what-is-docker-io-in-relation-to-docker-ce-and-docker-ee) 看到这么一句话

也就是说, docker.io 是docker的老版本, 让你通过sudo apt-get remove docker docker-engine docker.io 这个命令进行卸载.

 后来在安装docker-ce时, 总是安装不成功, 不存在docker-ce

Docker-ce安装笔记

安装文档参考https://docs.docker.com/install/linux/docker-ce/ubuntu/

1.  首先是安装aufs

      1.1  对于Ubuntu 16以上的版本, 由于其内核支持OverlayFS, 所以Docker-ce默认使用的是overlay2存储驱动, 所以不需要安装aufs.

    官方描述:For Ubuntu 16.04 and higher, the Linux kernel includes support for OverlayFS, and Docker CE uses the overlay2 storage driver by default. If you need to use aufs instead, you need to configure it manually.

1.2   对于Ubuntu14, 则需要安装aufs. (而我的恰巧是Ubuntu14)

sudo apt-get update
sudo apt-get install  linux-image-extra-$(uname -r)  linux-image-extra-virtual

2.   更新apt, 如果刚刚更新过了, 可以不用再次更新. 

sudo apt-get update

3. 安装可以让apt命令获取https的资源的一些软件.

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

4. 添加Docker官方GPG key

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

可能会有些慢, 我第一次使用这个命令的时候, 直接卡主了.  多试几次, 直至其返回OK.

5. 验证key, 通过搜索fingerprint 的最后8个字母.

$ sudo apt-key fingerprint 0EBFCD88

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

其实, 从下图中可以看到, 这个包是2017-02-22发布的.

6. 为apt添加stable资源库.  (即使你是通过edge  test repositories, 都需要添加这一步). 不同的环境的添加方式不同,

#x86_64 / amd64
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

#armhf
$ sudo add-apt-repository \
"deb [arch=armhf] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

#IBM Power (ppc64le)
$ sudo add-apt-repository \
"deb [arch=ppc64el] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

#IBM Z (s390x)
$ sudo add-apt-repository \
"deb [arch=s390x] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

其中我的是x86_64的环境, 所以我使用了第一个命令

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

7. 再次更新apt

$ sudo apt-get update

8. 正式开始安装docker-ce

$ sudo apt-get install docker-ce

9. 检查版本, 大功告成

$ docker --version

现在的docker版本是18.06.1, 安装完成

"Unable to locate package docker-ce"这个错误表明系统无法找到名为docker-ce的软件包进行安装。这通常是由于以下原因之一造成的: 1. 您的系统源列表中没有包含docker-ce软件包的源。 2. 您的系统源列表需要更新,以便能够找到docker-ce软件包。 3. 您的系统版本与docker-ce软件包的兼容性不匹配。 为了解决这个问题,您可以尝试以下方法: 1. 确保您的系统已经添加了正确的docker-ce软件包源。您可以检查您的系统源列表文件,确保其中包含了docker-ce软件包的源。如果没有,请参考docker官方文档或您所使用的Linux发行版的文档,添加正确的软件包源。 2. 运行`sudo apt update`命令来更新您的系统源列表。这将使系统能够找到最新的docker-ce软件包。 3. 如果您的系统版本与docker-ce软件包的兼容性不匹配,您可以尝试升级您的系统到与docker-ce软件包兼容的版本。请参考您所使用的Linux发行版的文档,了解如何进行系统升级。 请根据您的具体情况尝试这些方法,并确保按照正确的步骤进行操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Ubuntu安装docker报错:Package ‘docker-ce‘ has no installation candidate](https://blog.csdn.net/MrFDd/article/details/123159028)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [docker学习笔记3【 E: Unable to locate package docker镜像无法安装软件】](https://blog.csdn.net/wy_97/article/details/78976609)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值