1. 程式人生 > >Docker 17.12版本安裝

Docker 17.12版本安裝

Docker Ubuntu16.04 最新版本Docker安裝手冊 Docker安裝手冊

環境:

操作系統:Ubuntu 16.04.3 LTS

Docker版本:17.12.1-ce

1、配置IP地址

sudo vim /etc/network/interfaces

auto ens33

iface ens33 inet static

address 172.16.0.100

netmask 255.255.255.0

gateway 172.16.0.2

2、配置APT軟件源

sudo vim /etc/apt/sources.list

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable

# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

3、更新APT源索引

sudo apt-get update

4、允許通過HTTPS方式使用APT

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

5、添加Docker 官方源GPG KEY

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

6、驗證GPG KEY添加是否成功

sudo apt-key fingerprint 0EBFCD88

7、設置安裝Stable 版本的Docker

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

8、更新APT索引並安裝Docker

sudo apt-get update

sudo apt-get install docker-ce

9、查看Docker版本

sudo docker version

sudo docker --version

sudo docker info

10、驗證Docker安裝是否成功

sudo docker run hello-world

11、啟動或關閉Docker engine

systemctl start docker.service #啟動Docker 服務

systemctl status docker.service #查看Docker服務狀態

systemctl stop docker.service #關閉Docker 服務


Docker 17.12版本安裝