因为之前一直使用的是centos6.x系统,因为公司考虑转用docker代替VMware的ESXI,所以就开始了我的docker折腾之旅。
在安装Ubuntu之前我已经用centos6.7+升级内核的办法使用了一段时间docker1.7.1版本,后面装了一个cSphere的docker集群管理工具,发现docker1.7.1版本有很大的漏洞,因为官网的docker对Ubuntu的支持比较好,而且内核也比较新,所以决定转用。然后就有了昨天的U盘安装Ubuntu的文字记录。
废话少说,今天的坑是装好了系统,配置了好多次手动指定IP,但是就是上不了外网,但是自动获取可以,反复折腾了好多次,最后是我同事随便查看了一下,什么也没改动就可以ping通外网了。有时候不得不说,这是命!
连上网络开始用apt-get update更新包管理器然后apt-get install docker 安装发现是比较低的版本,
然后改用官方的脚本安装:
$ wget -qO- https://get.docker.com/ | sh
可能是因为网络的关系,一直卡在下载的地方,过不去。所以找了其他网上朋友的方法,实测可行
操作如下:
这边记录ubuntu安装过程,首先是官网文档
If you haven’t already done so, log into your Ubuntu instance.
Open a terminal window.
Add the new
gpg
key.$ apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Open the
/etc/apt/sources.list.d/docker.list
file in your favorite editor.If the file doesn’t exist, create it.
Remove any existing entries.
Add an entry for your Ubuntu operating system.
The possible entries are:
# Ubuntu Precise deb https://apt.dockerproject.org/repo ubuntu-precise main# Ubuntu Trusty deb https://apt.dockerproject.org/repo ubuntu-trusty main# Ubuntu Vivid deb https://apt.dockerproject.org/repo ubuntu-vivid main# Ubuntu Wily deb https://apt.dockerproject.org/repo ubuntu-wily main
Save and close the
/etc/apt/sources.list.d/docker.list
file.Update the
apt
package index.$ apt-get update
Purge the old repo if it exists.
$ apt-get purge lxc-docker*
Verify that
apt
is pulling from the right repository.$ apt-cache policy docker-engine
root@ubuntu:/etc/apt/sources.list.d# apt-cache policy docker-engine docker-engine: Installed: (none) Candidate: 1.10.1-0~wily Version table: 1.10.1-0~wily 0 500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages 1.10.1-0~trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.10.1-0~precise 0 500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages 1.10.0-0~wily 0 500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages 1.10.0-0~trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.10.0-0~precise 0 500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages 1.9.1-0~wily 0 500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages 1.9.1-0~vivid 0 500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages 1.9.1-0~trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.9.1-0~precise 0 500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages 1.9.0-0~wily 0 500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages 1.9.0-0~vivid 0 500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages 1.9.0-0~trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.9.0-0~precise 0 500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages 1.8.3-0~wily 0 500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages 1.8.3-0~vivid 0 500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages 1.8.3-0~trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.8.3-0~precise 0 500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages 1.8.2-0~wily 0 500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages 1.8.2-0~vivid 0 500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages 1.8.2-0~trusty 0 500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages 1.8.2-0~precise 0 500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages
最后选择需要的版本安装即可。命令如下:
$ apt-get install -y docker-engine=1.10.1-0~trusty
部分资料转载自http://www.cnblogs.com/yanghuahui/p/4874937.html
转载于:https://blog.51cto.com/gentle/1743463