1. Add the EPEL Repository

  1. rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2. Update your system

  1. yum update -y

3. Install

  1. yum install -y docker-io

4. Configure

  1. service docker start
  2. chkconfig docker on
  3. docker info

5. Download a Docker Container

  1. docker pull centos

6. Run a Docker Container

  1. docker run -i -t centos /bin/bash

7. Find Docker Container

  1. docker search ubuntu

FAQ

1. Faild to start docker on CentOS 6.x

/usr/bin/docker: relocation error: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference``

  1. the lib-device-mapper that you have isn't exporting a symbol ("Base") that Docker needs.
  2. this by upgrading lib-device-mapper to version 1.02.90.
  3. # You may have to enable the public_ol6_latest repo in order to get this package.
  4. sudo yum-config-manager --enable public_ol6_latest
  5. sudo yum install device-mapper-event-libs

2. Faild to use docker

Get http:///var/run/docker.sock/v1.19/info: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?``

  1. # this is because docker no restart ok.
  2. pkill -9 docker && service docker start

3. HowTo save ‘docker run -i -t xxx /bin/bash’

  1. docker ps -l
  2. docker commit ID newname
  3. docker images