How to install Docker on CentOS 7.3 Server

CentOS Tutorial – Today I am going to show you how to install Docker on CentOS 7.3 Server. As you know, Docker is a popular virtualization software. Installing Docker on CentOS 7.3 is very easy. When this post is written, Docker version 1.12 is available on CentOS repository.

Steps to install Docker on CentOS 7

Step 1. Install Docker

[root@centos-512mb-sgp1-01 ~]# yum install docker
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vastspace.net
 * extras: mirror.vastspace.net
 * updates: mirror.vastspace.net
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.12.6-16.el7.centos will be installed
--> Processing Dependency: docker-common = 2:1.12.6-16.el7.centos for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: docker-client = 2:1.12.6-16.el7.centos for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-3.10 for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: lvm2 >= 2.02.112 for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: container-selinux >= 2:2.10-2 for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: skopeo-containers for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Processing Dependency: libseccomp.so.2()(64bit) for package: 2:docker-1.12.6-16.el7.centos.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.10-2.el7 will be installed
---> Package docker-client.x86_64 2:1.12.6-16.el7.centos will be installed
---> Package docker-common.x86_64 2:1.12.6-16.el7.centos will be installed
---> Package libseccomp.x86_64 0:2.3.1-2.el7 will be installed
---> Package lvm2.x86_64 7:2.02.166-1.el7_3.4 will be installed
--> Processing Dependency: lvm2-libs = 7:2.02.166-1.el7_3.4 for package: 7:lvm2-2.02.166-1.el7_3.4.x86_64
--> Processing Dependency: device-mapper-persistent-data >= 0.6.3-1 for package: 7:lvm2-2.02.166-1.el7_3.4.x86_64
--> Processing Dependency: liblvm2app.so.2.2(Base)(64bit) for package: 7:lvm2-2.02.166-1.el7_3.4.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02(Base)(64bit) for package: 7:lvm2-2.02.166-1.el7_3.4.x86_64
--> Processing Dependency: liblvm2app.so.2.2()(64bit) for package: 7:lvm2-2.02.166-1.el7_3.4.x86_64
--> Processing Dependency: libdevmapper-event.so.1.02()(64bit) for package: 7:lvm2-2.02.166-1.el7_3.4.x86_64
---> Package oci-register-machine.x86_64 1:0-3.11.gitdd0daef.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.1.7-2.git2788078.el7 will be installed
--> Processing Dependency: libyajl.so.2()(64bit) for package: 1:oci-systemd-hook-0.1.7-2.git2788078.el7.x86_64
---> Package skopeo-containers.x86_64 1:0.1.18-1.el7 will be installed
--> Running transaction check
---> Package device-mapper-event-libs.x86_64 7:1.02.135-1.el7_3.4 will be installed
---> Package device-mapper-persistent-data.x86_64 0:0.6.3-1.el7 will be installed
--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: device-mapper-persistent-data-0.6.3-1.el7.x86_64
--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: device-mapper-persistent-data-0.6.3-1.el7.x86_64
--> Processing Dependency: libaio.so.1()(64bit) for package: device-mapper-persistent-data-0.6.3-1.el7.x86_64
---> Package lvm2-libs.x86_64 7:2.02.166-1.el7_3.4 will be installed
--> Processing Dependency: device-mapper-event = 7:1.02.135-1.el7_3.4 for package: 7:lvm2-libs-2.02.166-1.el7_3.4.x86_64
---> Package yajl.x86_64 0:2.0.4-4.el7 will be installed
--> Running transaction check
---> Package device-mapper-event.x86_64 7:1.02.135-1.el7_3.4 will be installed
---> Package libaio.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                       Arch   Version                     Repository
                                                                           Size
================================================================================
Installing:
 docker                        x86_64 2:1.12.6-16.el7.centos      extras   14 M
Installing for dependencies:
 container-selinux             noarch 2:2.10-2.el7                extras   28 k
 device-mapper-event           x86_64 7:1.02.135-1.el7_3.4        updates 178 k
 device-mapper-event-libs      x86_64 7:1.02.135-1.el7_3.4        updates 177 k
 device-mapper-persistent-data x86_64 0.6.3-1.el7                 base    368 k
 docker-client                 x86_64 2:1.12.6-16.el7.centos      extras  3.2 M
 docker-common                 x86_64 2:1.12.6-16.el7.centos      extras   72 k
 libaio                        x86_64 0.3.109-13.el7              base     24 k
 libseccomp                    x86_64 2.3.1-2.el7                 base     56 k
 lvm2                          x86_64 7:2.02.166-1.el7_3.4        updates 1.1 M
 lvm2-libs                     x86_64 7:2.02.166-1.el7_3.4        updates 986 k
 oci-register-machine          x86_64 1:0-3.11.gitdd0daef.el7     extras  1.0 M
 oci-systemd-hook              x86_64 1:0.1.7-2.git2788078.el7    extras   30 k
 skopeo-containers             x86_64 1:0.1.18-1.el7              extras  7.6 k
 yajl                          x86_64 2.0.4-4.el7                 base     39 k

Transaction Summary
================================================================================
Install  1 Package (+14 Dependent packages)

Total download size: 21 M
Installed size: 71 M
Is this ok [y/d/N]: 

Step 2. Start Docker

Use this command to start Docker

systemctl start docker
systemctl enable docker

Don’t forget to check the status

docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Min 2017-05-14 14:50:39 UTC; 2min 3s ago
     Docs: http://docs.docker.com
 Main PID: 9444 (dockerd-current)
   CGroup: /system.slice/docker.service
           ├─9444 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-o...
           └─9448 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim -...

Mei 14 14:50:38 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:38.932837169Z" level=warning msg="Docker could not enable ...ystem"
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:38.997821799Z" level=info msg="Graph migration to content-...conds"
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:38.999355806Z" level=info msg="Loading containers: start."
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:39.022003890Z" level=info msg="Firewalld running: false"
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:39.222060407Z" level=info msg="Default bridge (docker0) is...dress"
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:39.300726372Z" level=info msg="Loading containers: done."
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:39.300942149Z" level=info msg="Daemon has completed initialization"
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:39.300985000Z" level=info msg="Docker daemon" commit="3a09...1.12.6
Mei 14 14:50:39 centos-512mb-sgp1-01 systemd[1]: Started Docker Application Container Engine.
Mei 14 14:50:39 centos-512mb-sgp1-01 dockerd-current[9444]: time="2017-05-14T14:50:39.319986533Z" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.

Thank you for reading this post on how to install Docker on CentOS 7.3.

Admin

Leave a Reply

Your email address will not be published. Required fields are marked *