您的位置:首页 > 运维架构 > Docker

Ubuntu 14.04下安装docker 过程

2016-12-02 15:32 573 查看

安装步骤

步骤1. 按官网的来

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


步骤2. 按官网的来

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


这里碰到错误如下:

gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net

gpgkeys: key 58118E89F3A912897C070ADBF76221572C52609D can’t be retrieved

gpg: no valid OpenPGP data found.

参考:https://github.com/docker/docker/issues/20022

解决方法:用能上外网的代理服务器



sudo apt-key adv --keyserver-options http-proxy='http://<domain>%5C<user>:<password>@<proxy_ip_or_name>:<port>/' --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D


步骤3: 按第一个参考文献的来的

$ sudo bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update


sudo apt-get update又报错了

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY D8576A8BA88D21E9\

解决方法和上面的差不多,参考的:http://wiki.jikexueyuan.com/project/docker-practice/about-docker-practice.html

$ sudo apt-key adv --keyserver-options http-proxy='http://<domain>%5C<user>:<password>@<proxy_ip_or_name>:<port>/' --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys D8576A8BA88D21E9


当在执行 ‘apt-get update’时有一点问题:



快速解决办法

递归移除 /etc/apt/sources.list.d/ 目录下的所有文件及目录,但是把docker.list留下了。

rm -r /etc/apt/sources.list.d/


步骤4:按第一个参考文献的来的

$ sudo apt-get install lxc-docker


步骤5: 按第一个参考文献

$ docker -v
Docker version 1.9.1, build a34a1d5


步骤6: 运行hello-world

sudo docker run hello-world


又报错了: Cannot connect to the Docker daemon. Is the docker daemon running on this host?



解决:参考https://github.com/docker/kitematic/issues/1219

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

应该是没加入到docker用户组里,参考一下



再运行就没错了。



参考文献

参考此篇:http://www.cnblogs.com/xiaoluosun/p/5520510.html 的”2.通过Docker源安装最新版本” 和 https://docs.docker.com/engine/installation/linux/ubuntulinux/ 官方文档, 下面两张图是这两个参考文献的截图



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu docker