Ubuntu16.04下安装Docker17.12

环境:

操作系统: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 服务

网站名称:Ubuntu16.04下安装Docker17.12
文章来源:http://www.mswzjz.cn/qtweb/news48/479898.html

攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能