docker 1.12是今年docker迄今发布的最为重要的一个版本,它大大增强了docker的内置编排机制。在一直被诟病的集群的构成方面也交出了自己的答卷。虽然增加的功能让你在使用的时候有一种在使用kubernetes的感觉,但这个世界不就是这样么,你有的我也有,我有的是原生态。闲话不说,安装。
设定Yum
docker缺省的Yum库使用的是main,基本上是稳定的版本。目前该版本为1.10。而在centos上安装只需要设定为experimental。将其baseurl设定为https://yum.dockerproject.org/repo/experimental/centos/7/即可。以后升到1.99估计也可以用同样的花招抢先试用吧。以下为设定方式:
确认旧的docker相关的组件并删除
你的机器上一定有用centos简易安装方式yum install docker安装的各种docker组件。安装1.12之前先把它们删掉吧,不然后面有可能还是会提示你删除的。
-
-
- 1
-
-
- 2
-
-
- 3
-
-
- 4
-
-
- 5
-
-
- 6
-
-
- 7
-
-
- 8
-
-
- 9
-
-
- 10
-
- [root@host32 ~]# rpm -qa |grep docker
- docker-selinux-1.10.3-44.el7.centos.x86_64
- docker-common-.x86_64
- docker-forward-journald-.x86_64
- docker-.x86_64
- [root@host32 ~]#
- [root@host32 ~]# yum -y remove docker-selinux-1.10.3-44.el7.centos.x86_64
- [root@host32 ~]# yum -y remove docker-common-1.10.3-44.el7.centos.x86_64
- [root@host32 ~]# yum -y remove docker-forward-journald-1.10.3-44.el7.centos.x86_64
- [root@host32 ~]# yum -y remove docker-1.10.3-44.el7.centos.x86_64
安装docker-engine
安装命令:yum -y install docker-engine
-
-
- 1
-
-
- 2
-
-
- 3
-
-
- 4
-
-
- 5
-
-
- 6
-
-
- 7
-
-
- 8
-
-
- 9
-
-
- 10
-
-
- 11
-
-
- 12
-
-
- 13
-
-
- 14
-
-
- 15
-
-
- 16
-
-
- 17
-
-
- 18
-
-
- 19
-
-
- 20
-
-
- 21
-
-
- 22
-
-
- 23
-
-
- 24
-
-
- 25
-
-
- 26
-
-
- 27
-
-
- 28
-
-
- 29
-
-
- 30
-
-
- 31
-
-
- 32
-
-
- 33
-
-
- 34
-
-
- 35
-
-
- 36
-
-
- 37
-
-
- 38
-
-
- 39
-
-
- 40
-
-
- 41
-
-
- 42
-
-
- 43
-
-
- 44
-
-
- 45
-
-
- 46
-
-
- 47
-
-
- 48
-
-
- 49
-
-
- 50
-
-
- 51
-
-
- 52
-
-
- 53
-
-
- 54
-
-
- 55
-
-
- 56
-
-
- 57
-
-
- 58
-
-
- 59
-
-
- 60
-
-
- 61
-
-
- 62
-
- [root@host32 ~]# yum install -y docker-engine
- Loaded plugins: fastestmirror,langpacks
- dockerrepo | 2.9 kB 00:00
- dockerrepo/primary_db | 49 kB 03
- Loading mirror speeds from cached hostfile
- * base: mirrors.tuna.tsinghua.edu.cn
- * epel: mirror.premi.st
- * extras: mirrors.cn
- * updates: mirrors.aliyun.com
- Resolving Dependencies
- --> Running transaction check
- ---> Package docker-engine.x86_64 0:1.12.0-1.el7.centos will be installed
- --> Processing Dependency: docker-engine-selinux >= .centos for package: docker-engine-.x86_64
- --> Running transaction check
- ---> Package docker-engine-selinux.noarch .centos will be installed
- --> Finished Dependency Resolution
-
- Dependencies Resolved
-
- ===================================================================================================================================================
- Package Arch Version Repository Size
- ===================================================================================================================================================
- Installing:
- docker-engine x86_64 .centos dockerrepo 19 M
- Installing for dependencies:
- docker-engine-selinux noarch 28 k
-
- Transaction Summary
- ===================================================================================================================================================
- Install 1 Package (+1 Dependent package)
-
- Total download size: 19 M
- Installed size: 79 M
- Downloading packages:
- warning: /var/cache/yum/x86_64/7/dockerrepo/packages/docker-engine-selinux-.noarch.rpm: Header V4 RSA/SHA512 Signature,key ID 2c52609d: NOKEY
- Public key for docker-engine-selinux-.rpm is not installed
- (1/2): docker-engine-selinux-.rpm | 28 kB 02
- (2/2): docker-engine-.x86_64.rpm | 19 MB 07:34
- ---------------------------------------------------------------------------------------------------------------------------------------------------
- Total 43 kB/s | 34
- Retrieving key from https://yum.org/gpg
- Importing GPG key 0x2C52609D:
- Userid : "Docker Release Tool (releasedocker) <docker@docker.com>"
- Fingerprint: 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d
- From : https://yum.org/gpg
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- Installing : docker-engine-selinux-.noarch 2
- Installing : docker-engine-.x86_64 2
- Verifying : docker-engine-selinux-2
- Verifying : docker-engine-2
-
- Installed:
- docker-engine.centos
-
- Dependency Installed:
- docker-engine-selinux.centos
-
- Complete!
- [root@host32 ~]#
设定自启动
命令:systemctl enable docker
启动docker服务
命令:systemctl start docker
确认docker版本
命令:docker info转载自:http://blog.csdn.net/liumiaocn/article/details/52130852
确认server version为1.12