https://www.cnblogs.com/xred/p/3845215.htmlhtml
中間碰到的問題:linux
一、ssl認證問題,直接安裝ca-certificatesdocker
二、yum命令很差使問題,redhat安裝yumapi
三、vm沒法連互聯網問題,修改vm的配置,改爲NAS安全
四、epel資源mirror錯誤問題,解決辦法是修改epel.conf路徑爲base。cors
名詞socket |
解釋tcp |
備註ui |
Selinuxthis |
安全加強型 Linux(Security-Enhanced Linux)簡稱 SELinux。它是一個 Linux 內核模塊,也是 Linux 的一個安全子系統。 |
|
LXC |
LXC爲Linux Container的簡寫;Linux Container容器是一種內核虛擬化技術,能夠提供輕量級的虛擬化,以便隔離進程和資源。LXC與docker的關係:(1)Docker並非LXC的替代品,Docker的底層就是使用了LXC來實現的。LXC將Linux進程沙盒化,使得進程之間相互隔離,而且可以控制各進程的資源分配。 |
|
EPEL |
EPEL的全稱叫 Extra Packages for Enterprise Linux 。EPEL是由 Fedora 社區打造,爲 RHEL 及衍生髮行版如 CentOS、Scientific Linux 等提供高質量軟件包的項目。裝上了 EPEL以後,就至關於添加了一個第三方源。 |
|
hop5.repo |
Centos 6.x Package Repository http://www.hop5.in/yum/el6/repoview/ |
|
因爲Selinux和LXC有衝突,因此須要禁用selinux。編輯/etc/selinux/config,設置兩個關鍵變量。
SELINUX=disabled
SELINUXTYPE=targeted
1 sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo
[root@guang ~]# yum install docker-io
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package docker-io.x86_64 0:0.6.2-1.el6 will be installed
--> Processing Dependency: lxc >= 0.8.0 for package: docker-io-0.6.2-1.el6.x86_64
--> Processing Dependency: kernel-ml-aufs >= 3.10.5 for package: docker-io-0.6.2-1.el6.x86_64
--> Running transaction check
---> Package kernel-ml-aufs.x86_64 0:3.10.5-3.el6 will be installed
---> Package lxc.x86_64 0:1.0.11-1.el6 will be installed
--> Processing Dependency: lua-lxc(x86-64) = 1.0.11-1.el6 for package: lxc-1.0.11-1.el6.x86_64
--> Processing Dependency: lua-alt-getopt for package: lxc-1.0.11-1.el6.x86_64
--> Processing Dependency: liblxc.so.1()(64bit) for package: lxc-1.0.11-1.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.11-1.el6 will be installed
--> Processing Dependency: lua-filesystem for package: lua-lxc-1.0.11-1.el6.x86_64
---> Package lxc-libs.x86_64 0:1.0.11-1.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 0.6.2-1.el6 hop5 1.3 M
Installing for dependencies:
kernel-ml-aufs x86_64 3.10.5-3.el6 hop5 33 M
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.11-1.el6 epel 16 k
lxc x86_64 1.0.11-1.el6 epel 124 k
lxc-libs x86_64 1.0.11-1.el6 epel 257 k
Transaction Summary
=============================================================================================================================================================
Install 7 Package(s)
Total size: 35 M
Total download size: 289 k
Installed size: 160 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): lua-alt-getopt-0.7.0-1.el6.noarch.rpm | 6.9 kB 00:00
(2/3): lua-filesystem-1.4.2-1.el6.x86_64.rpm | 24 kB 00:00
(3/3): lxc-libs-1.0.11-1.el6.x86_64.rpm | 257 kB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 61 kB/s | 289 kB 00:04
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 (@/epel-release-6-8.noarch)
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.11-1.el6.x86_64 1/7
Installing : lua-filesystem-1.4.2-1.el6.x86_64 2/7
Installing : lua-lxc-1.0.11-1.el6.x86_64 3/7
Installing : lua-alt-getopt-0.7.0-1.el6.noarch 4/7
Installing : lxc-1.0.11-1.el6.x86_64 5/7
Installing : kernel-ml-aufs-3.10.5-3.el6.x86_64 6/7
Installing : docker-io-0.6.2-1.el6.x86_64 7/7
Verifying : docker-io-0.6.2-1.el6.x86_64 1/7
Verifying : lxc-1.0.11-1.el6.x86_64 2/7
Verifying : lua-lxc-1.0.11-1.el6.x86_64 3/7
Verifying : lxc-libs-1.0.11-1.el6.x86_64 4/7
Verifying : lua-alt-getopt-0.7.0-1.el6.noarch 5/7
Verifying : kernel-ml-aufs-3.10.5-3.el6.x86_64 6/7
Verifying : lua-filesystem-1.4.2-1.el6.x86_64 7/7
Installed:
docker-io.x86_64 0:0.6.2-1.el6
Dependency Installed:
kernel-ml-aufs.x86_64 0:3.10.5-3.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.11-1.el6
lxc.x86_64 0:1.0.11-1.el6 lxc-libs.x86_64 0:1.0.11-1.el6
Complete!
[root@guang ~]# docker -h
Usage of docker:
-D=false: Debug mode
-H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use
-api-enable-cors=false: Enable CORS requests in the remote api.
-b="": Attach containers to a pre-existing network bridge. Use 'none' to disable container networking
-d=false: Daemon mode
-dns="": Set custom dns servers
-g="/var/lib/docker": Path to graph storage base dir.
-p="/var/run/docker.pid": File containing process PID
-r=false: Restart previously running containers
-v=false: Print version information and quit
[root@guang ~]#