2017年8月30日 星期三

CentOS 6.9 安裝 Docker

CentOS 6.9 安裝 Docker 重新開機後, 你可以在 '/root/anaconda-ks.cfg' kickstart檔案中, 找到所選擇的安裝選項。 外掛 LinuxIC-4.2.2-2.iso
su root
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom/CentOS69
./install.sh
網路設定
sudo vi /etc/hosts
192.168.0.10 centos5
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 
sudo vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME="centos69"
sudo vi /etc/sysconfig/network-scripts/ifcfg-etho
DEVICE=eth0
#HWADDR=00:15:5D:28:20:14
TYPE=Ethernet
#UUID=e1b73b32-6772-4038-bbf8-2c76f45ea90e
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=172.20.10.8
NETMASK=255.255.255.0
GATEWAY=172.20.10.1
DNS1=8.8.8.8
reboot重開機
/etc/init.d/network restart
安裝EPEL
[root@docker CentOS69]# yum install epel-release
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
 * base: centos.cs.nctu.edu.tw
 * extras: centos.cs.nctu.edu.tw
 * updates: centos.cs.nctu.edu.tw
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:6-8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                   Arch                                Version                             Repository                           Size
=============================================================================================================================================================
Installing:
 epel-release                              noarch                              6-8                                 extras                               14 k

Transaction Summary
=============================================================================================================================================================
Install       1 Package(s)

Total download size: 14 k
Installed size: 22 k
Is this ok [y/N]: Y
Downloading Packages:
epel-release-6-8.noarch.rpm                                                                                                           |  14 kB     00:00     
警告:rpmts_HdrFromFdno: 表頭 V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) 
 Package: centos-release-6-9.el6.12.3.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-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 : epel-release-6-8.noarch                                                                                                                   1/1 
  Verifying  : epel-release-6-8.noarch                                                                                                                   1/1 

Installed:
  epel-release.noarch 0:6-8                                                                                                                                  

Complete!
[root@docker CentOS69]# 
安裝Docker
[root@docker CentOS69]# yum install docker-i
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
^C

Exiting on user cancel
[root@docker CentOS69]# yum install docker-io
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.cs.nctu.edu.tw
 * epel: mirror01.idc.hinet.net
 * extras: centos.cs.nctu.edu.tw
 * updates: centos.cs.nctu.edu.tw
Resolving Dependencies
--> Running transaction check
---> Package docker-io.x86_64 0:1.7.1-2.el6 will be installed
--> Processing Dependency: lxc for package: docker-io-1.7.1-2.el6.x86_64
--> Processing Dependency: libcgroup for package: docker-io-1.7.1-2.el6.x86_64
--> Running transaction check
---> Package libcgroup.x86_64 0:0.40.rc1-23.el6 will be installed
---> Package lxc.x86_64 0:1.0.10-2.el6 will be installed
--> Processing Dependency: lua-lxc(x86-64) = 1.0.10-2.el6 for package: lxc-1.0.10-2.el6.x86_64
--> Processing Dependency: lua-alt-getopt for package: lxc-1.0.10-2.el6.x86_64
--> Processing Dependency: liblxc.so.1()(64bit) for package: lxc-1.0.10-2.el6.x86_64
--> Running transaction check
---> Package lua-alt-getopt.noarch 0:0.7.0-1.el6 will be installed
---> Package lua-lxc.x86_64 0:1.0.10-2.el6 will be installed
--> Processing Dependency: lua-filesystem for package: lua-lxc-1.0.10-2.el6.x86_64
---> Package lxc-libs.x86_64 0:1.0.10-2.el6 will be installed
--> Running transaction check
---> Package lua-filesystem.x86_64 0:1.4.2-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                  Arch                             Version                                      Repository                      Size
=============================================================================================================================================================
Installing:
 docker-io                                x86_64                           1.7.1-2.el6                                  epel                           4.6 M
Installing for dependencies:
 libcgroup                                x86_64                           0.40.rc1-23.el6                              base                           131 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.10-2.el6                                 epel                            16 k
 lxc                                      x86_64                           1.0.10-2.el6                                 epel                           124 k
 lxc-libs                                 x86_64                           1.0.10-2.el6                                 epel                           258 k

Transaction Summary
=============================================================================================================================================================
Install       7 Package(s)

Total download size: 5.1 M
Installed size: 20 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): docker-io-1.7.1-2.el6.x86_64.rpm                                                                                               | 4.6 MB     00:01     
(2/7): libcgroup-0.40.rc1-23.el6.x86_64.rpm                                                                                           | 131 kB     00:00     
(3/7): lua-alt-getopt-0.7.0-1.el6.noarch.rpm                                                                                          | 6.9 kB     00:00     
(4/7): lua-filesystem-1.4.2-1.el6.x86_64.rpm                                                                                          |  24 kB     00:00     
(5/7): lua-lxc-1.0.10-2.el6.x86_64.rpm                                                                                                |  16 kB     00:00     
(6/7): lxc-1.0.10-2.el6.x86_64.rpm                                                                                                    | 124 kB     00:00     
(7/7): lxc-libs-1.0.10-2.el6.x86_64.rpm                                                                                               | 258 kB     00:00     
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        2.5 MB/s | 5.1 MB     00:02     
警告:rpmts_HdrFromFdno: 表頭 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) 
 Package: epel-release-6-8.noarch (@extras)
 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
  Installing : lxc-libs-1.0.10-2.el6.x86_64                                                                                                              1/7 
  Installing : lua-filesystem-1.4.2-1.el6.x86_64                                                                                                         2/7 
  Installing : lua-lxc-1.0.10-2.el6.x86_64                                                                                                               3/7 
  Installing : libcgroup-0.40.rc1-23.el6.x86_64                                                                                                          4/7 
  Installing : lua-alt-getopt-0.7.0-1.el6.noarch                                                                                                         5/7 
  Installing : lxc-1.0.10-2.el6.x86_64                                                                                                                   6/7 
  Installing : docker-io-1.7.1-2.el6.x86_64                                                                                                              7/7 
  Verifying  : lua-lxc-1.0.10-2.el6.x86_64                                                                                                               1/7 
  Verifying  : lxc-libs-1.0.10-2.el6.x86_64                                                                                                              2/7 
  Verifying  : lxc-1.0.10-2.el6.x86_64                                                                                                                   3/7 
  Verifying  : docker-io-1.7.1-2.el6.x86_64                                                                                                              4/7 
  Verifying  : lua-alt-getopt-0.7.0-1.el6.noarch                                                                                                         5/7 
  Verifying  : libcgroup-0.40.rc1-23.el6.x86_64                                                                                                          6/7 
  Verifying  : lua-filesystem-1.4.2-1.el6.x86_64                                                                                                         7/7 

Installed:
  docker-io.x86_64 0:1.7.1-2.el6                                                                                                                             

Dependency Installed:
  libcgroup.x86_64 0:0.40.rc1-23.el6     lua-alt-getopt.noarch 0:0.7.0-1.el6     lua-filesystem.x86_64 0:1.4.2-1.el6     lua-lxc.x86_64 0:1.0.10-2.el6    
  lxc.x86_64 0:1.0.10-2.el6              lxc-libs.x86_64 0:1.0.10-2.el6         

Complete!
[root@docker CentOS69]# service docker status
docker 已停止
[root@docker CentOS69]# service docker start
Starting cgconfig service: [  確定  ]
Starting docker:        [  確定  ]
[root@docker CentOS69]# 

沒有留言:

張貼留言