Skip to content

Instantly share code, notes, and snippets.

@mingder78
Created December 10, 2015 08:32
Show Gist options
  • Save mingder78/632209af1b8591ada5d9 to your computer and use it in GitHub Desktop.
Save mingder78/632209af1b8591ada5d9 to your computer and use it in GitHub Desktop.
install docker on Cent OS 6.x
➜ keycloak cat /etc/*release
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)
➜ keycloak 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
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
➜ keycloak
➜ keycloak sudo !!
➜ keycloak sudo rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[sudo] password for mwang:
Retrieving http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Preparing... ########################################### [100%]
package epel-release-6-8.noarch is already installed
➜ keycloak yum update -y
Loaded plugins: fastestmirror
You need to be root to perform this command.
➜ keycloak sudo !!
➜ keycloak sudo yum update -y
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
epel/metalink | 4.9 kB 00:00
sudo yum -y install docker-io
* base: centos.cs.nctu.edu.tw
* epel: mirror01.idc.hinet.net
* extras: centos.cs.nctu.edu.tw
* updates: centos.cs.nctu.edu.tw
sudo service docker start
base | 3.7 kB 00:00
sudo chkconfig docker on
epel | 4.3 kB 00:00
epel/primary_db | 5.7 MB 00:00
extras | 3.4 kB 00:00
imeyer_runit_/signature | 836 B 00:00
imeyer_runit_/signature | 951 B 00:00 ...
updates | 3.4 kB 00:00
updates/primary_db | 2.7 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be updated
---> Package libpng.x86_64 2:1.2.49-2.el6_7 will be an update
---> Package libxml2.x86_64 0:2.7.6-20.el6 will be updated
---> Package libxml2.x86_64 0:2.7.6-20.el6_7.1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Updating:
libpng x86_64 2:1.2.49-2.el6_7 updates 182 k
libxml2 x86_64 2.7.6-20.el6_7.1 updates 803 k
Transaction Summary
=============================================================================
Upgrade 2 Package(s)
Total download size: 985 k
Downloading Packages:
(1/2): libpng-1.2.49-2.el6_7.x86_64.rpm | 182 kB 00:00
(2/2): libxml2-2.7.6-20.el6_7.1.x86_64.rpm | 803 kB 00:00
-----------------------------------------------------------------------------
Total 19 MB/s | 985 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Updating : 2:libpng-1.2.49-2.el6_7.x86_64 1/4
Updating : libxml2-2.7.6-20.el6_7.1.x86_64 2/4
Cleanup : 2:libpng-1.2.49-1.el6_2.x86_64 3/4
Cleanup : libxml2-2.7.6-20.el6.x86_64 4/4
Verifying : libxml2-2.7.6-20.el6_7.1.x86_64 1/4
Verifying : 2:libpng-1.2.49-2.el6_7.x86_64 2/4
Verifying : 2:libpng-1.2.49-1.el6_2.x86_64 3/4
Verifying : libxml2-2.7.6-20.el6.x86_64 4/4
Updated:
libpng.x86_64 2:1.2.49-2.el6_7 libxml2.x86_64 0:2.7.6-20.el6_7.1
Complete!
➜ keycloak sudo yum -y install docker-io
Loaded plugins: fastestmirror
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
--> Processing Dependency: bridge-utils for package: docker-io-1.7.1-2.el6.x86_64
--> Running transaction check
---> Package bridge-utils.x86_64 0:1.2-10.el6 will be installed
---> Package libcgroup.x86_64 0:0.40.rc1-16.el6 will be installed
---> Package lxc.x86_64 0:1.0.8-1.el6 will be installed
--> Processing Dependency: lua-lxc(x86-64) = 1.0.8-1.el6 for package: lxc-1.0.8-1.el6.x86_64
--> Processing Dependency: lua-alt-getopt for package: lxc-1.0.8-1.el6.x86_64
--> Processing Dependency: liblxc.so.1()(64bit) for package: lxc-1.0.8-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.8-1.el6 will be installed
--> Processing Dependency: lua-filesystem for package: lua-lxc-1.0.8-1.el6.x86_64
---> Package lxc-libs.x86_64 0:1.0.8-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 1.7.1-2.el6 epel 4.6 M
Installing for dependencies:
bridge-utils x86_64 1.2-10.el6 base 30 k
libcgroup x86_64 0.40.rc1-16.el6 base 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.8-1.el6 epel 16 k
lxc x86_64 1.0.8-1.el6 epel 122 k
lxc-libs x86_64 1.0.8-1.el6 epel 255 k
Transaction Summary
=============================================================================
Install 8 Package(s)
Total download size: 5.1 M
Installed size: 21 M
Downloading Packages:
(1/8): bridge-utils-1.2-10.el6.x86_64.rpm | 30 kB 00:00
(2/8): docker-io-1.7.1-2.el6.x86_64.rpm | 4.6 MB 00:00
(3/8): libcgroup-0.40.rc1-16.el6.x86_64.rpm | 129 kB 00:00
(4/8): lua-alt-getopt-0.7.0-1.el6.noarch.rpm | 6.9 kB 00:00
(5/8): lua-filesystem-1.4.2-1.el6.x86_64.rpm | 24 kB 00:00
(6/8): lua-lxc-1.0.8-1.el6.x86_64.rpm | 16 kB 00:00
(7/8): lxc-1.0.8-1.el6.x86_64.rpm | 122 kB 00:00
(8/8): lxc-libs-1.0.8-1.el6.x86_64.rpm | 255 kB 00:00
-----------------------------------------------------------------------------
Total 508 kB/s | 5.1 MB 00:10
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lxc-libs-1.0.8-1.el6.x86_64 1/8
Installing : lua-filesystem-1.4.2-1.el6.x86_64 2/8
Installing : lua-lxc-1.0.8-1.el6.x86_64 3/8
Installing : libcgroup-0.40.rc1-16.el6.x86_64 4/8
Installing : lua-alt-getopt-0.7.0-1.el6.noarch 5/8
Installing : lxc-1.0.8-1.el6.x86_64 6/8
Installing : bridge-utils-1.2-10.el6.x86_64 7/8
Installing : docker-io-1.7.1-2.el6.x86_64 8/8
Verifying : lxc-libs-1.0.8-1.el6.x86_64 1/8
Verifying : bridge-utils-1.2-10.el6.x86_64 2/8
Verifying : lxc-1.0.8-1.el6.x86_64 3/8
Verifying : docker-io-1.7.1-2.el6.x86_64 4/8
Verifying : lua-lxc-1.0.8-1.el6.x86_64 5/8
Verifying : lua-alt-getopt-0.7.0-1.el6.noarch 6/8
Verifying : libcgroup-0.40.rc1-16.el6.x86_64 7/8
Verifying : lua-filesystem-1.4.2-1.el6.x86_64 8/8
Installed:
docker-io.x86_64 0:1.7.1-2.el6
Dependency Installed:
bridge-utils.x86_64 0:1.2-10.el6 libcgroup.x86_64 0:0.40.rc1-16.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.8-1.el6 lxc.x86_64 0:1.0.8-1.el6
lxc-libs.x86_64 0:1.0.8-1.el6
Complete!
➜ keycloak sudo service docker start
Starting cgconfig service: [ OK ]
Starting docker: [ OK ]
➜ keycloak sudo chkconfig docker on
➜ keycloak hostname
VM42
➜ keycloak docker ps -a
Get http:///var/run/docker.sock/v1.19/containers/json?all=1: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
➜ keycloak sudo !!
➜ keycloak sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment