Ubuntu安装Docker步骤

环境:Ubuntu Trusty 14.04 (LTS)

前提条件:

Docker requires a 64-bit installation regardless of your Ubuntu version.

Additionally, your kernel must be 3.10 at minimum.

1.检查Linux系统内核。

$ uname -r

3.13.0-24-generic

2.更新系统源。

$ sudo apt-get update

3.更新Https和CA证书。

ensure that APT works with the https method, and that CA certificates are installed.

$ sudo apt-get install apt-transport-https ca-certificates

4.添加新的GPG Key。

$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

5.添加Docker源。

$ echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list

6.更新系统源。

$ sudo apt-get update

7.校验APT是否正在拉取争取的源。

Each entry should have the URL https://apt.dockerproject.org/repo/

$ apt-cache policy docker-engine

docker-engine:
Installed: 1.12.2-0~trusty
Candidate: 1.12.2-0~trusty
Version table:
*** 1.12.2-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
100 /var/lib/dpkg/status
1.12.1-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
1.12.0-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
1.11.2-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
1.11.1-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages

8.安装linux-image-extra-*包。

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

9.更新系统源。

$ sudo apt-get update

10.安装Docker。

$ sudo apt-get install docker-engine

11.启动Docker Daemon。

$ sudo service docker start

12.校验Docker是否安装正确。

$ sudo docker run hello-world

This command downloads a test image and runs it in a container.

When the container runs, it prints an informational message. Then, it exits.

 

卸载步骤:

1. 卸载Docker package

$ sudo apt-get purge docker-engine

2.卸载Docker package以及依赖

$ sudo apt-get autoremove --purge docker-engine

3.删除所有相关的Image、Container和Volume

$ rm -rf /var/lib/docker

参考:https://docs.docker.com/engine/installation/linux/ubuntulinux/

转载于:https://www.cnblogs.com/edisonxiang/p/6067130.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值