Before installation
root@pts/0 # uname -r
2.6.32-279.el6.x86_64
For Centos-6.5, the Docker
package is part of Extra Packages for Enterprise Linux (EPEL) repository, a community effort to create and maintain additional packages for the RHEL distribution.
Install epel package
root@pts/0 # rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.jZDBGF: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
root@pts/0 # ls -lart /etc/yum.repos.d/
total 32
-rw-r--r--. 1 root root 2593 Jun 26 2012 CentOS-Vault.repo
-rw-r--r--. 1 root root 626 Jun 26 2012 CentOS-Media.repo
-rw-r--r--. 1 root root 637 Jun 26 2012 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1926 Jun 26 2012 CentOS-Base.repo
-rw-r--r-- 1 root root 1056 Nov 5 2012 epel-testing.repo
-rw-r--r-- 1 root root 957 Nov 5 2012 epel.repo
# here you need to modify epel.repo
before:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
gpgcheck=1
after change
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
gpgcheck=0
Install docker
yum install docker-io
======================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================
Installing:
docker-io x86_64 1.4.1-3.el6 epel 4.5 M
Installing for dependencies:
libcgroup x86_64 0.40.rc1-15.el6_6 updates 129 k
lua-alt-getopt noarch 0.7.0-1.el6 epel 6.9 k
lua-filesystem x86_64 1.4.2-1.el6 epel 24 k
lua-lxc x86_64 1.0.7-1.el6 epel 15 k
lxc x86_64 1.0.7-1.el6 epel 120 k
lxc-libs x86_64 1.0.7-1.el6 epel 249 k
Transaction Summary
======================================================================================================================================
Install 7 Package(s)
Start docker
service docker start
## or you do like this
/etc/init.d/docker start
## here after you start docker ,and try docker info or docker version, it showed errors
FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
## and find no docker process
root@pts/0 # ps -ef|grep docker
root 2216 1351 0 13:12 pts/0 00:00:00 grep docker
fix error
yum install -y device-mapper
======================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================
Updating:
device-mapper x86_64 1.02.90-2.el6_6.1 updates 173 k
Updating for dependencies:
device-mapper-event x86_64 1.02.90-2.el6_6.1 updates 122 k
device-mapper-event-libs x86_64 1.02.90-2.el6_6.1 updates 116 k
device-mapper-libs x86_64 1.02.90-2.el6_6.1 updates 218 k
libblkid x86_64 2.17.2-12.18.el6 base 116 k
libuuid x86_64 2.17.2-12.18.el6 base 69 k
util-linux-ng x86_64 2.17.2-12.18.el6 base 1.6 M
Transaction Summary
======================================================================================================================================
Upgrade 7 Package(s)
check if install docker again
/etc/init.d/docker start
root@pts/0 # /etc/init.d/docker start
Starting docker: [ OK ]
root@pts/0 # ps -ef|grep docker
root 2623 1 5 13:18 pts/0 00:00:00 /usr/bin/docker -d
root 2738 1351 0 13:18 pts/0 00:00:00 grep docker
root@pts/3 # docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8/1.4.1
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8/1.4.1
Try to pull images
root@pts/0 # docker pull dockercolin/resin:youyuan
Pulling repository dockercolin/resin
05cbafe808b6: Pulling dependent layers
511136ea3c5a: Download complete
b6718650e87e: Download complete
493bab5fff45: Download complete
9dbcac75201e: Download complete
d21eb06e11c9: Downloading [==========> ] 32.97 MB/164.8 MB 55m36s
d21eb06e11c9: Pulling metadata
Docker install successfully!