ubuntu 1604安装docker-ce 记录

以前在linux 内核为2.x的低版本中安装过docker,但是很多功能特性都无法使用,本次是在ubuntu 16.04上安装,记录安装过程,方便后续查阅。

一、安装前准备:

1. 安装包,允许 apt 命令 HTTPS 访问 Docker 源。

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

2. 添加 Docker 官方的 GPG

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

3. 将 Docker 的源添加到 /etc/apt/sources.list

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

二、安装 Docker

$ sudo apt-get update
$ sudo apt-get install docker-ce

三、镜像加速

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://24051e92.m.daocloud.io

四、重启docker:

$ systemctl restart docker.service

五、测试:

至此,docker 已经安装成功。

如果想安装docker.io, 可以使用如下命令:

apt-get update && apt-get install docker.io

原文地址:https://www.cnblogs.com/logo-fox/p/8297156.html