特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过。如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/mao2080/
1、配置yum源
路径/etc/yum.repos.d/docker.repo
[dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg
2、通过yum安装
a、安装命令
# yum install docker-engine
# service docker start
# service docker status
b、安装日志
[root@localhost ~]# yum install docker-engine Setting up Install Process base | 3.7 kB 00:00 base/primary_db | 4.7 MB 00:04 dockerrepo | 2.9 kB 00:00 dockerrepo/primary_db | 3.3 kB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 29 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 1.9 MB 00:01 Resolving Dependencies --> Running transaction check ---> Package docker-engine.x86_64 0:1.7.1-1.el6 will be installed --> Processing Dependency: libcgroup for package: docker-engine-1.7.1-1.el6.x86_64 --> Running transaction check ---> Package libcgroup.x86_64 0:0.40.rc1-23.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved =========================================================================================================================================================================================== Package Arch Version Repository Size =========================================================================================================================================================================================== Installing: docker-engine x86_64 1.7.1-1.el6 dockerrepo 4.5 M Installing for dependencies: libcgroup x86_64 0.40.rc1-23.el6 base 131 k Transaction Summary =========================================================================================================================================================================================== Install 2 Package(s) Total download size: 4.7 M Installed size: 20 M Is this ok [y/N]: y Downloading Packages: (1/2): docker-engine-1.7.1-1.el6.x86_64.rpm | 4.5 MB 00:06 (2/2): libcgroup-0.40.rc1-23.el6.x86_64.rpm | 131 kB 00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 723 kB/s | 4.7 MB 00:06 warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 2c52609d: NOKEY Retrieving key from https://yum.dockerproject.org/gpg Importing GPG key 0x2C52609D: Userid: "Docker Release Tool (releasedocker) <docker@docker.com>" From : https://yum.dockerproject.org/gpg Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : libcgroup-0.40.rc1-23.el6.x86_64 1/2 Installing : docker-engine-1.7.1-1.el6.x86_64 2/2 Verifying : libcgroup-0.40.rc1-23.el6.x86_64 1/2 Verifying : docker-engine-1.7.1-1.el6.x86_64 2/2 Installed: docker-engine.x86_64 0:1.7.1-1.el6 Dependency Installed: libcgroup.x86_64 0:0.40.rc1-23.el6 Complete! [root@localhost ~]# service docker start Starting cgconfig service: [ OK ] Starting docker: [ OK ] [root@localhost ~]# service docker status docker (pid 7382) is running... [root@localhost ~]#
3、日志
# vim /var/log/docker