当前位置首页 > Ubuntu知识

(原)ubuntu14及ubuntu16中安装docker

阅读次数:246 次  来源:admin  发布时间:

转载请注明出处:

http://www.cnblogs.com/darkknightzh/p/5653739.html

参考网址:

http://blog.csdn.net/yangzhenping/article/details/43671843

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

http://blog.csdn.net/xundh/article/details/46441403

1. 由于老版本的docker支持的命令很少,因而需要卸载老版本的docker。

(http://blog.csdn.net/yangzhenping/article/details/43671843)

sudo docker -v  
sudo apt-get remove docker 

老版本的docker支持的命令:(原)ubuntu14及ubuntu16中安装docker

2. 在ubuntu14上面重新安装新版本的docker

(http://blog.csdn.net/xundh/article/details/46441403)

直接使用如下命令即可

wget -qO- https://get.docker.com/ | sh

q后面是大写字母O

说明:有时候赋值上面这句话,就是提示有问题,去上面的网址复制,就可以执行。。。

3. 在ubuntu16上面重新安装新版本的docker

参考docker官方文档(https://docs.docker.com/engine/installation/linux/ubuntulinux/)

说明:a. 上面网址有16.04,15.10,14.04,12.04的安装步骤。接下来只说在ubuntu16上怎么安装。

. ubuntu内核最低为3.10.使用如下命令查看内核版本:

uname -r

1)更新apt源:

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

终端中输入如下命令:

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

② 增加新的GPG key

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

③ 打开/etc/apt/sources.list.d/docker.list文件,删除里面的所有内容(需要超级管理员权限);如果不存在,创建。

④ 在③中的文件中增加 entry,并保存该文件:

deb https://apt.dockerproject.org/repo ubuntu-xenial main

注意:其他版本中的请查看上面的网址。Docker does not provide packages for all architectures. You can find nightly built binaries in https://master.dockerproject.org. To install docker on a multi-architecture system, add an [arch=...] clause to the entry. Refer to the Debian Multiarch wiki for details.

说明:之前安装docker时,只能安装到1.10,后来打开该文件,发现源不对。更改了之后,后面安装的就是最新的了。

⑤ 更新apt

sudo apt-get update

⑥ 如果有的话,清除老的repo

sudo apt-get purge lxc-docker

⑦ Verify that APT is pulling from the right repository.

apt-cache policy docker-engine

2)安装docker

① 终端中输入:

sudo apt-get update

② 安装docker:

sudo apt-get install docker-engine

③ Start the docker daemon:

sudo service docker start

④ 验证docker成功安装:

sudo docker run hello-world

结果如下:

(原)ubuntu14及ubuntu16中安装docker

可选的配置:见参考网址。

4. 新版本的docker:

(原)ubuntu14及ubuntu16中安装docker

新版本docker支持的命令:

(原)ubuntu14及ubuntu16中安装docker

(原)ubuntu14及ubuntu16中安装docker

上一篇:美女同事的烦恼:如何配置ApacheSkyWalking告警?
下一篇:八、frps服务端与nginx可共用80端口