本文简单的介绍如何在RHEL中部署Docker。
Docker是一个开源的应用容器引擎。它让开发者可以打包他们的应用以及应用的依赖包到一个可一直的容器中,以便后续发布到任何Linux的机器上。
关于Docker的介绍与相关资讯可以百度、谷歌,看到更多的相关信息。故,这里不赘述。
它的官方网站有两个:
https://www.docker.com/
https://www.docker.io/
官网提供了一个功能非常受限的字符交互终端,让你体验与理解Docker是什么。
地址:https://www.docker.com/tryit/
你可以开始一个Tutorial。
Docker官网提供的针对Red Hat Enterprise Linux的指导(URL:https://docs.docker.com/installation/rhel/)是基于EPEL项目的。
所以,你需要先配置好EPEL才可以继续。
EPEL:http://fedoraproject.org/wiki/EPEL
EPEL for RHEL6:http://mirrors.yun-idc.com/epel/6/i386/repoview/epel-release.html
Download Link is:http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm
Docker对于RHEL的版本要求为:6.5 or higher。
You will need RHEL 6.5 or higher, with a RHEL 6 kernel version 2.6.32-431 or higher as this has specific kernel fixes to allow Docker to work.
1
2
3
4
5
6
|
[
root
@
docker
~
]
# cat /etc/redhat-release
Red
Hat
Enterprise
Linux
Server
release
6.5
(
Santiago
)
[
root
@
docker
~
]
#
[
root
@
docker
~
]
# uname -a
Linux
docker
2.6.32
-
431.el6.x86_64
#1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[
root
@
docker
~
]
#
|
操作系统的当前状态:
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
|
[
root
@
docker
~
]
# cat /etc/hosts
127.0.0.1
localhost
192.168.56.135
docker
[
root
@
docker
~
]
#
[
root
@
docker
software
]
# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Jul 23 14:21:31 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID
=
87898515
-
bef6
-
4b21
-
a5dc
-
12ec7b9b03d0
/
ext4
defaults
1
1
UUID
=
3a67facc
-
4596
-
4cd3
-
82a5
-
c6ce46e06ab5
/
boot
ext4
defaults
1
2
UUID
=
7108feb5
-
7b06
-
4971
-
afe6
-
5af64455a59e
swap
swap
defaults
0
0
tmpfs
/
dev
/
shm
tmpfs
defaults
0
0
devpts
/
dev
/
pts
devpts
gid
=
5
,
mode
=
620
0
0
sysfs
/
sys
sysfs
defaults
0
0
proc
/
proc
proc
defaults
0
0
/
dev
/
sr1
/
iso
iso9660
defaults
0
0
[
root
@
docker
software
]
#
[
root
@
docker
software
]
# df -h
Filesystem
Size
Used
Avail
Use
%
Mounted
on
/
dev
/
sda2
18G
2.5G
15G
15
%
/
tmpfs
935M
72K
935M
1
%
/
dev
/
shm
/
dev
/
sda1
291M
39M
238M
14
%
/
boot
/
dev
/
sr1
3.6G
3.6G
0
100
%
/
iso
[
root
@
docker
software
]
#
|
修改YUM本地缓存策略(默认关闭,修改为打开;即本地保留YUM从网路上下载的RPM包)
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
|
[
root
@
docker
~
]
# cat /etc/yum.conf
[
main
]
cachedir
=
/
software
/
yum
/
$
basearch
/
$
releasever
keepcache
=
1
debuglevel
=
2
logfile
=
/
var
/
log
/
yum
.
log
exactarch
=
1
obsoletes
=
1
gpgcheck
=
1
plugins
=
1
installonly_limit
=
3
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[
root
@
docker
~
]
#
|
(其中:cachedir为RPM本地缓存的路径;keepcache为是否保留:0-不保留、1-保留)
创建存放下载文件的目录:/software
1
2
3
4
5
6
7
8
|
[
root
@
docker
~
]
# mkdir /software
[
root
@
docker
~
]
# ll -d /software
drwxr
-
xr
-
x
.
2
root
root
4096
Jul
23
06
:
57
/
software
[
root
@
docker
~
]
# ls -al /software/
total
8
drwxr
-
xr
-
x
.
2
root
root
4096
Jul
23
06
:
57
.
dr
-
xr
-
xr
-
x
.
23
root
root
4096
Jul
23
06
:
57
.
.
[
root
@
docker
~
]
#
|
下载“EPEL for RHEL6”的软件包到“/software”
(Link:http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
[
root
@
docker
~
]
# cd /software
[
root
@
docker
software
]
# ll
total
0
[
root
@
docker
software
]
# wget http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm
--
2014
-
07
-
23
07
:
05
:
35
--
http
:
//mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm
Resolving
mirrors
.
yun
-
idc
.
com
.
.
.
114.112.41.90
Connecting
to
mirrors
.
yun
-
idc
.
com
|
114.112.41.90
|
:
80...
connected
.
HTTP
request
sent
,
awaiting
response
.
.
.
200
OK
Length
:
14540
(
14K
)
[
application
/
x
-
redhat
-
package
-
manager
]
Saving
to
:
“
epel
-
release
-
6
-
8.noarch.rpm”
100
%
[
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
>
]
14
,
540
--
.
-
K
/
s
in
0.1s
2014
-
07
-
23
07
:
05
:
36
(
108
KB
/
s
)
-
“
epel
-
release
-
6
-
8.noarch.rpm”
saved
[
14540
/
14540
]
[
root
@
docker
software
]
#
[
root
@
docker
software
]
# ll
total
16
-
rw
-
r
--
r
--
.
1
root
root
14540
Nov
5
2012
epel
-
release
-
6
-
8.noarch.rpm
[
root
@
docker
software
]
#
[
root
@
docker
software
]
# du -sh *
16K
epel
-
release
-
6
-
8.noarch.rpm
[
root
@
docker
software
]
#
|
安装EPEL
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[
root
@
docker
software
]
# ll /etc/yum.repos.d/
total
4
-
rw
-
r
--
r
--
.
1
root
root
529
Oct
30
2013
rhel
-
source
.
repo
[
root
@
docker
software
]
# rpm -ivh epel-release-6-8.noarch.rpm
warning
:
epel
-
release
-
6
-
8.noarch.rpm
:
Header
V3
RSA
/
SHA256
Signature
,
key
ID
0608b895
:
NOKEY
Preparing
.
.
.
########################################### [100%]
1
:
epel
-
release
########################################### [100%]
[
root
@
docker
software
]
# ll /etc/yum.repos.d/
total
12
-
rw
-
r
--
r
--
.
1
root
root
957
Nov
4
2012
epel
.
repo
-
rw
-
r
--
r
--
.
1
root
root
1056
Nov
4
2012
epel
-
testing
.
repo
-
rw
-
r
--
r
--
.
1
root
root
529
Oct
30
2013
rhel
-
source
.
repo
[
root
@
docker
software
]
#
|
配置本地ISO光盘的YUM源
1
2
3
4
5
6
|
[
root
@
docker
software
]
# cat /etc/yum.repos.d/iso.repo
[
ISO
]
name
=
ISO
baseurl
=
file
:
///iso
gpgcheck
=
0
[
root
@
docker
software
]
#
|
初始化YUM库
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
|
[
root
@
docker
software
]
# yum clean all
Loaded
plugins
:
product
-
id
,
refresh
-
packagekit
,
security
,
subscription
-
manager
This
system
is
not
registered
to
Red
Hat
Subscription
Management
.
You
can
use
subscription
-
manager
to
register
.
Cleaning
repos
:
ISO
epel
Cleaning
up
Everything
[
root
@
docker
software
]
# yum clean metadata
Loaded
plugins
:
product
-
id
,
refresh
-
packagekit
,
security
,
subscription
-
manager
This
system
is
not
registered
to
Red
Hat
Subscription
Management
.
You
can
use
subscription
-
manager
to
register
.
Cleaning
repos
:
ISO
epel
0
metadata
files
removed
0
sqlite
files
removed
0
metadata
files
removed
[
root
@
docker
software
]
#
[
root
@
docker
software
]
# yum repolist
Loaded
plugins
:
product
-
id
,
refresh
-
packagekit
,
security
,
subscription
-
manager
This
system
is
not
registered
to
Red
Hat
Subscription
Management
.
You
can
use
subscription
-
manager
to
register
.
ISO
|
3.9
kB
00
:
00
.
.
.
ISO
/
primary_db
|
3.1
MB
00
:
00
.
.
.
epel
/
metalink
|
5.0
kB
00
:
00
epel
|
4.4
kB
00
:
00
epel
/
primary_db
|
6.2
MB
00
:
46
repo
id
repo
name
status
ISO
ISO
3
,
690
epel
Extra
Packages
for
Enterprise
Linux
6
-
x86
_64
11
,
029
repolist
:
14
,
719
[
root
@
docker
software
]
#
|
Installation:Docker
docker相关的软件包是由EPEL提供的:
1
2
3
4
5
6
7
8
9
10
11
|
[
root
@
docker
software
]
# yum list | grep --color docker
This
system
is
not
registered
to
Red
Hat
Subscription
Management
.
You
can
use
subscription
-
manager
to
register
.
docker
.
x86
_64
1.5
-
5.el6
epel
docker
-
io
.
x86
_64
1.0.0
-
6.el6
epel
docker
-
registry
.
noarch
0.7.1
-
2.el6
epel
fedora
-
dockerfiles
.
noarch
0
-
0.5.git122ef5d.el6
epel
golang
-
github
-
fsouza
-
go
-
dockerclient
-
devel
.
i686
golang
-
github
-
fsouza
-
go
-
dockerclient
-
devel
.
x86_64
python
-
docker
-
py
.
x86
_64
0.2.3
-
8.el6
epel
python
-
docker
-
registry
-
core
.
noarch
1.0.6
-
2.el6
epel
[
root
@
docker
software
]
#
|
这里安装“docker-io”(docker-io与docker是冲突的,如果已经装过docker,那么需要先执行卸载的操作)
关于冲突,官方对此有说明:
If you already have the (unrelated) docker package installed, it will conflict with docker-io. There’s a bug report filed for it. To proceed with docker-io installation, please remove docker first.
The Bug Report URL:https://bugzilla.redhat.com/show_bug.cgi?id=1043676
(本环境没有预安装docker;如果需要卸载:yum remove docker;)
安装:Docker。
Command is:yum install docker
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
[
root
@
docker
software
]
# yum install docker-io
Loaded
plugins
:
product
-
id
,
refresh
-
packagekit
,
security
,
subscription
-
manager
This
system
is
not
registered
to
Red
Hat
Subscription
Management
.
You
can
use
subscription
-
manager
to
register
.
Setting
up
Install
Process
Resolving
Dependencies
--
>
Running
transaction
check
--
->
Package
docker
-
io
.
x86
_64
0
:
1.0.0
-
6.el6
will
be
installed
--
>
Processing
Dependency
:
lxc
for
package
:
docker
-
io
-
1.0.0
-
6.el6.x86_64
--
>
Processing
Dependency
:
libcgroup
for
package
:
docker
-
io
-
1.0.0
-
6.el6.x86_64
--
>
Running
transaction
check
--
->
Package
libcgroup
.
x86
_64
0
:
0.40.rc1
-
5.el6
will
be
installed
--
>
Processing
Dependency
:
redhat
-
lsb
-
core
for
package
:
libcgroup
-
0.40.rc1
-
5.el6.x86_64
--
->
Package
lxc
.
x86
_64
0
:
0.9.0
-
2.el6
will
be
installed
--
>
Processing
Dependency
:
liblxc
.
so
.
0
(
)
(
64bit
)
for
package
:
lxc
-
0.9.0
-
2.el6.x86_64
--
>
Running
transaction
check
--
->
Package
lxc
-
libs
.
x86
_64
0
:
0.9.0
-
2.el6
will
be
installed
--
->
Package
redhat
-
lsb
-
core
.
x86
_64
0
:
4.0
-
7.el6
will
be
installed
--
>
Processing
Dependency
:
perl
-
Test
-
Simple
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Processing
Dependency
:
perl
-
Test
-
Harness
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Processing
Dependency
:
perl
-
ExtUtils
-
MakeMaker
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Processing
Dependency
:
perl
-
CGI
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Processing
Dependency
:
/
usr
/
bin
/
pax
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Processing
Dependency
:
/
usr
/
bin
/
msgfmt
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Processing
Dependency
:
/
bin
/
gettext
for
package
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
--
>
Running
transaction
check
--
->
Package
gettext
.
x86
_64
0
:
0.17
-
16.el6
will
be
installed
--
>
Processing
Dependency
:
cvs
for
package
:
gettext
-
0.17
-
16.el6.x86_64
--
->
Package
pax
.
x86
_64
0
:
3.4
-
10.1.el6
will
be
installed
--
->
Package
perl
-
CGI
.
x86
_64
0
:
3.51
-
136.el6
will
be
installed
--
->
Package
perl
-
ExtUtils
-
MakeMaker
.
x86
_64
0
:
6.55
-
136.el6
will
be
installed
--
>
Processing
Dependency
:
perl
-
devel
for
package
:
perl
-
ExtUtils
-
MakeMaker
-
6.55
-
136.el6.x86_64
--
->
Package
perl
-
Test
-
Harness
.
x86
_64
0
:
3.17
-
136.el6
will
be
installed
--
->
Package
perl
-
Test
-
Simple
.
x86
_64
0
:
0.92
-
136.el6
will
be
installed
--
>
Running
transaction
check
--
->
Package
cvs
.
x86
_64
0
:
1.11.23
-
16.el6
will
be
installed
--
->
Package
perl
-
devel
.
x86
_64
4
:
5.10.1
-
136.el6
will
be
installed
--
>
Processing
Dependency
:
perl
(
ExtUtils
::
ParseXS
)
for
package
:
4
:
perl
-
devel
-
5.10.1
-
136.el6.x86_64
--
>
Processing
Dependency
:
gdbm
-
devel
for
package
:
4
:
perl
-
devel
-
5.10.1
-
136.el6.x86_64
--
>
Processing
Dependency
:
db4
-
devel
for
package
:
4
:
perl
-
devel
-
5.10.1
-
136.el6.x86_64
--
>
Running
transaction
check
--
->
Package
db4
-
devel
.
x86
_64
0
:
4.7.25
-
18.el6_4
will
be
installed
--
>
Processing
Dependency
:
db4
-
cxx
=
4.7.25
-
18.el6_4
for
package
:
db4
-
devel
-
4.7.25
-
18.el6_4.x86_64
--
>
Processing
Dependency
:
libdb_cxx
-
4.7.so
(
)
(
64bit
)
for
package
:
db4
-
devel
-
4.7.25
-
18.el6_4.x86_64
--
->
Package
gdbm
-
devel
.
x86
_64
0
:
1.8.0
-
36.el6
will
be
installed
--
->
Package
perl
-
ExtUtils
-
ParseXS
.
x86
_64
1
:
2.2003.0
-
136.el6
will
be
installed
--
>
Running
transaction
check
--
->
Package
db4
-
cxx
.
x86
_64
0
:
4.7.25
-
18.el6_4
will
be
installed
--
>
Finished
Dependency
Resolution
Dependencies
Resolved
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
Package
Arch
Version
Repository
Size
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
Installing
:
docker
-
io
x86
_64
1.0.0
-
6.el6
epel
4.5
M
Installing
for
dependencies
:
cvs
x86
_64
1.11.23
-
16.el6
ISO
712
k
db4
-
cxx
x86
_64
4.7.25
-
18.el6_4
ISO
588
k
db4
-
devel
x86
_64
4.7.25
-
18.el6_4
ISO
6.6
M
gdbm
-
devel
x86
_64
1.8.0
-
36.el6
ISO
25
k
gettext
x86
_64
0.17
-
16.el6
ISO
1.8
M
libcgroup
x86
_64
0.40.rc1
-
5.el6
ISO
125
k
lxc
x86
_64
0.9.0
-
2.el6
epel
78
k
lxc
-
libs
x86
_64
0.9.0
-
2.el6
epel
116
k
pax
x86
_64
3.4
-
10.1.el6
ISO
69
k
perl
-
CGI
x86
_64
3.51
-
136.el6
ISO
209
k
perl
-
ExtUtils
-
MakeMaker
x86
_64
6.55
-
136.el6
ISO
293
k
perl
-
ExtUtils
-
ParseXS
x86
_64
1
:
2.2003.0
-
136.el6
ISO
45
k
perl
-
Test
-
Harness
x86
_64
3.17
-
136.el6
ISO
231
k
perl
-
Test
-
Simple
x86
_64
0.92
-
136.el6
ISO
112
k
perl
-
devel
x86
_64
4
:
5.10.1
-
136.el6
ISO
423
k
redhat
-
lsb
-
core
x86
_64
4.0
-
7.el6
ISO
25
k
Transaction
Summary
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
===
Install
17
Package
(
s
)
Total
download
size
:
16
M
Installed
size
:
61
M
Is
this
ok
[
y
/
N
]
:
y
Downloading
Packages
:
(
4
/
17
)
:
docker
-
io
-
1.0.0
-
6.el6.x86_64.rpm
|
4.5
MB
00
:
44
(
8
/
17
)
:
lxc
-
0.9.0
-
2.el6.x86_64.rpm
|
78
kB
00
:
00
(
9
/
17
)
:
lxc
-
libs
-
0.9.0
-
2.el6.x86_64.rpm
|
116
kB
00
:
01
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-
Total
342
kB
/
s
|
16
MB
00
:
47
warning
:
rpmts_HdrFromFdno
:
Header
V3
RSA
/
SHA256
Signature
,
key
ID
0608b895
:
NOKEY
Retrieving
key
from
file
:
///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing
GPG
key
0x0608B895
:
Userid
:
EPEL
(
6
)
<
epel
@
fedoraproject
.
org
>
Package
:
epel
-
release
-
6
-
8.noarch
(
installed
)
From
:
/
etc
/
pki
/
rpm
-
gpg
/
RPM
-
GPG
-
KEY
-
EPEL
-
6
Is
this
ok
[
y
/
N
]
:
y
Running
rpm_check_debug
Running
Transaction
Test
Transaction
Test
Succeeded
Running
Transaction
Warning
:
RPMDB
altered
outside
of
yum
.
Installing
:
lxc
-
libs
-
0.9.0
-
2.el6.x86_64
1
/
17
Installing
:
lxc
-
0.9.0
-
2.el6.x86_64
2
/
17
Installing
:
cvs
-
1.11.23
-
16.el6.x86_64
3
/
17
Installing
:
gettext
-
0.17
-
16.el6.x86_64
4
/
17
Installing
:
perl
-
CGI
-
3.51
-
136.el6.x86_64
5
/
17
Installing
:
pax
-
3.4
-
10.1.el6.x86_64
6
/
17
Installing
:
db4
-
cxx
-
4.7.25
-
18.el6_4.x86_64
7
/
17
Installing
:
db4
-
devel
-
4.7.25
-
18.el6_4.x86_64
8
/
17
Installing
:
gdbm
-
devel
-
1.8.0
-
36.el6.x86_64
9
/
17
Installing
:
perl
-
Test
-
Harness
-
3.17
-
136.el6.x86_64
10
/
17
Installing
:
perl
-
ExtUtils
-
MakeMaker
-
6.55
-
136.el6.x86_64
11
/
17
Installing
:
1
:
perl
-
ExtUtils
-
ParseXS
-
2.2003.0
-
136.el6.x86_64
12
/
17
Installing
:
4
:
perl
-
devel
-
5.10.1
-
136.el6.x86_64
13
/
17
Installing
:
perl
-
Test
-
Simple
-
0.92
-
136.el6.x86_64
14
/
17
Installing
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
15
/
17
Installing
:
libcgroup
-
0.40.rc1
-
5.el6.x86_64
16
/
17
Installing
:
docker
-
io
-
1.0.0
-
6.el6.x86_64
17
/
17
ISO
/
productid
|
1.7
kB
00
:
00
.
.
.
Verifying
:
gdbm
-
devel
-
1.8.0
-
36.el6.x86_64
1
/
17
Verifying
:
db4
-
cxx
-
4.7.25
-
18.el6_4.x86_64
2
/
17
Verifying
:
4
:
perl
-
devel
-
5.10.1
-
136.el6.x86_64
3
/
17
Verifying
:
gettext
-
0.17
-
16.el6.x86_64
4
/
17
Verifying
:
lxc
-
0.9.0
-
2.el6.x86_64
5
/
17
Verifying
:
perl
-
Test
-
Harness
-
3.17
-
136.el6.x86_64
6
/
17
Verifying
:
pax
-
3.4
-
10.1.el6.x86_64
7
/
17
Verifying
:
perl
-
CGI
-
3.51
-
136.el6.x86_64
8
/
17
Verifying
:
redhat
-
lsb
-
core
-
4.0
-
7.el6.x86_64
9
/
17
Verifying
:
perl
-
ExtUtils
-
MakeMaker
-
6.55
-
136.el6.x86_64
10
/
17
Verifying
:
libcgroup
-
0.40.rc1
-
5.el6.x86_64
11
/
17
Verifying
:
docker
-
io
-
1.0.0
-
6.el6.x86_64
12
/
17
Verifying
:
perl
-
Test
-
Simple
-
0.92
-
136.el6.x86_64
13
/
17
Verifying
:
1
:
perl
-
ExtUtils
-
ParseXS
-
2.2003.0
-
136.el6.x86_64
14
/
17
Verifying
:
db4
-
devel
-
4.7.25
-
18.el6_4.x86_64
15
/
17
Verifying
:
cvs
-
1.11.23
-
16.el6.x86_64
16
/
17
Verifying
:
lxc
-
libs
-
0.9.0
-
2.el6.x86_64
17
/
17
Installed
:
docker
-
io
.
x86
_64
0
:
1.0.0
-
6.el6
Dependency
Installed
:
cvs
.
x86
_64
0
:
1.11.23
-
16.el6
db4
-
cxx
.
x86
_64
0
:
4.7.25
-
18.el6_4
db4
-
devel
.
x86
_64
0
:
4.7.25
-
18.el6_4
gdbm
-
devel
.
x86
_64
0
:
1.8.0
-
36.el6
gettext
.
x86
_64
0
:
0.17
-
16.el6
libcgroup
.
x86
_64
0
:
0.40.rc1
-
5.el6
lxc
.
x86
_64
0
:
0.9.0
-
2.el6
lxc
-
libs
.
x86
_64
0
:
0.9.0
-
2.el6
pax
.
x86
_64
0
:
3.4
-
10.1.el6
perl
-
CGI
.
x86
_64
0
:
3.51
-
136.el6
perl
-
ExtUtils
-
MakeMaker
.
x86
_64
0
:
6.55
-
136.el6
perl
-
ExtUtils
-
ParseXS
.
x86
_64
1
:
2.2003.0
-
136.el6
perl
-
Test
-
Harness
.
x86
_64
0
:
3.17
-
136.el6
perl
-
Test
-
Simple
.
x86
_64
0
:
0.92
-
136.el6
perl
-
devel
.
x86
_64
4
:
5.10.1
-
136.el6
redhat
-
lsb
-
core
.
x86
_64
0
:
4.0
-
7.el6
Complete
!
[
root
@
docker
software
]
#
|
(如果你已经装过docker-io,只是版本太老,那么可以选择升级:yum update docker-io)
安装成功后的状态
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
63
64
65
|
[
root
@
docker
~
]
# rpm -qa | grep docker
docker
-
io
-
1.0.0
-
6.el6.x86_64
[
root
@
docker
~
]
# rpm -ql docker-io
/
etc
/
bash_completion
.
d
/
etc
/
bash_completion
.
d
/
docker
.
bash
/
etc
/
rc
.
d
/
init
.
d
/
docker
/
etc
/
sysconfig
/
docker
/
etc
/
udev
/
rules
.
d
/
etc
/
udev
/
rules
.
d
/
80
-
docker
.
rules
/
usr
/
bin
/
docker
/
usr
/
libexec
/
docker
/
usr
/
libexec
/
docker
/
dockerinit
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
AUTHORS
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
CHANGELOG
.
md
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
CONTRIBUTING
.
md
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
FIXME
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
LICENSE
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
LICENSE
-
vim
-
syntax
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
MAINTAINERS
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
NOTICE
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
README
-
vim
-
syntax
.
md
/
usr
/
share
/
doc
/
docker
-
io
-
1.0.0
/
README
.
md
/
usr
/
share
/
man
/
man1
/
docker
-
attach
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
build
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
commit
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
cp
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
diff
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
events
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
export
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
history
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
images
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
import
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
info
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
inspect
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
kill
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
load
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
login
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
logs
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
port
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
ps
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
pull
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
push
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
restart
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
rm
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
rmi
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
run
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
save
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
search
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
start
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
stop
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
tag
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
top
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
-
wait
.
1.gz
/
usr
/
share
/
man
/
man1
/
docker
.
1.gz
/
usr
/
share
/
man
/
man5
/
Dockerfile
.
5.gz
/
usr
/
share
/
vim
/
vimfiles
/
doc
/
usr
/
share
/
vim
/
vimfiles
/
doc
/
dockerfile
.
txt
/
usr
/
share
/
vim
/
vimfiles
/
ftdetect
/
usr
/
share
/
vim
/
vimfiles
/
ftdetect
/
dockerfile
.
vim
/
usr
/
share
/
vim
/
vimfiles
/
syntax
/
usr
/
share
/
vim
/
vimfiles
/
syntax
/
dockerfile
.
vim
/
usr
/
share
/
zsh
/
site
-
functions
/
_docker
/
var
/
lib
/
docker
[
root
@
docker
~
]
#
|
启动Docker服务,并设置开机启动。
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[
root
@
docker
~
]
# service docker status
docker
is
stopped
[
root
@
docker
~
]
#
[
root
@
docker
~
]
# service docker start
Starting
cgconfig
service
:
[
OK
]
Starting
docker
:
[
OK
]
[
root
@
docker
~
]
# chkconfig --list docker
docker
0
:
off
1
:
off
2
:
on
3
:
on
4
:
on
5
:
on
6
:
off
[
root
@
docker
~
]
# chkconfig docker off
[
root
@
docker
~
]
# chkconfig --list docker
docker
0
:
off
1
:
off
2
:
off
3
:
off
4
:
off
5
:
off
6
:
off
[
root
@
docker
~
]
#
[
root
@
docker
~
]
#
|
查看运行状态:
1
2
3
4
5
6
7
|
[
root
@
docker
~
]
# service docker status
docker
(
pid
24791
)
is
running
.
.
.
[
root
@
docker
~
]
#
[
root
@
docker
~
]
# ps -ef | grep docker
root
24791
1
0
07
:
24
pts
/
0
00
:
00
:
00
/
usr
/
bin
/
docker
-
d
root
24928
2375
0
07
:
26
pts
/
0
00
:
00
:
00
grep
docker
[
root
@
docker
~
]
#
|
本地缓存的RPM包:
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
|
[
root
@
docker
~
]
# cd /software/
[
root
@
docker
software
]
# ls
epel
-
release
-
6
-
8.noarch.rpm
yum
[
root
@
docker
software
]
# tree yum/
yum
/
└──
x86
_64
└──
6Server
├──
epel
│
├──
21cfd0e047de02ef00cb08c7bf38be49716cc0527d8bf52c3fa94621486e43e4
-
primary
.
sqlite
│
├──
cachecookie
│
├──
metalink
.
xml
│
├──
packages
│
│
├──
docker
-
io
-
1.0.0
-
6.el6.x86_64.rpm
│
│
├──
lxc
-
0.9.0
-
2.el6.x86_64.rpm
│
│
└──
lxc
-
libs
-
0.9.0
-
2.el6.x86_64.rpm
│
└──
repomd
.
xml
└──
ISO
├──
73f064f26711880e0087a719eb9c5ab413278449d91b085c70bc44e3ee67c5c5
-
primary
.
sqlite
├──
cachecookie
├──
packages
├──
productid
.
gz
└──
repomd
.
xml
6
directories
,
11
files
[
root
@
docker
software
]
#
|