How To Install Docker CE on CentOS/RHEL 7/6

Docker is an application that makes it simple and easy to run application processes in a container, which are like virtual machines, only more portable, more resource-friendly, and more dependent on the host operating system.

Docker

See Also:

This tutorial helps us to install Docker on CentOS/RHEL 7/6.

Step 1: Add Docker Repository

Run the following command which will add the Docker repository to your system:

# yum -y install  wget
# wget https://download.docker.com/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo

Step 2: Install Docker

Now that the Docker repository is enabled and install the latest version of Docker CE using the following command.

# yum install docker-ce

Step 3: Start Docker Service

After, Docker package has been installed, start the docker service and enable it at boot time using the below commands:

On RHEL/CentOS 7

# systemctl start docker
# systemctl enable docker

On RHEL/CentOS 6

# service docker start
# chkconfig dokcer on

Step 4: Check Docker Version

Run mention command to check the docker version.

# docker version
Client:
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:35:01 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:06:30 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Step 5: Check Docker Info

Now, you can check some docker info using mention command.

# docker info
Containers: 7
 Running: 0
 Paused: 0
 Stopped: 7
Images: 4
Server Version: 18.09.1
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 96ec2177ae841256168fcf76954f7177af9446eb
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-957.1.3.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.51GiB
Name: DockerCentOS71.fyre.ibm.com
ID: UDWR:FKMS:H3PC:LQMT:IG4I:P7OA:3V5B:C44C:FBPZ:5YN6:NEH5:WJQ6
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Step 6: Test Docker

Run the Docker hello-world container to test if the installation completed successfully.

# docker run hello-world

Docker test

Enjoy it!

Comments
  1. 5 years ago

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.