Monday, March 26, 2018

How to Install Docker on RHEL 7 / Centos 7


Docker is free and ASCII text file software system. It automates the preparation of any application as a light-weight, portable, independent instrumentation which will run nearly anyplace. generally you develop software system on your laptop/desktop. you'll build a instrumentation together with your app, and it will check run on your pc. it'll scale in cloud, VM, VPS, bare-metal and a lot of. There area unit 2 versions of manual laborer. the primary one bundled with RHEL/CentOS seven distro and might be put in with the yum. The second version distributed by the manual laborer project referred to as docker-ce (community free version) and might be put in by the official manual laborer project repo. The third version distributed by the manual laborer project referred to as docker-ee (Enterprise paid version) and might be put in by the official manual laborer project repo. This page shows a way to install, setup and use manual laborer or manual laborer Ce on RHEL seven or CentOS seven server and make your 1st instrumentation.

How to install and use Docker on RHEL seven or CentOS seven (method 1)

The procedure to put in docker is as follows:

1. Open the terminal application or login to the remote box victimisation ssh command:

[root@local ~]# ssh root@remote-server-name

2. kind the subsequent command to put in stevedore via yum provided by Red Hat:

[root@server ~]# sudo yum install docker

3. kind the subsequent command to put in the newest version of docker atomic number 58 (community edition):


[root@server ~]# sudo yum remove docker docker-common docker-selinux docker-engine
[root@server ~]# sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
[root@server ~]# sudo yum install docker-ce

Let us see all information in details at the side of examples.

How to install docker on CentOS seven / RHEL seven victimisation yum

Type the subsequent yum command:

[root@local ~]# yum install docker -y


How to install docker CE on CentOS seven (method 2)

First take away older version of docker (if any):


[root@server ~]# sudo yum remove docker docker-common docker-selinux docker-engine-selinux docker-engine docker-ce

Next install required packages:

[root@local ~]# sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Configure the docker-ce repo:


[root@server ~]# sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo


Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
Finally install docker-ce:

[root@local ~]# sudo yum install docker-ce




How to enable docker service



[root@local ~]# sudo systemctl enable docker.service

Sample outputs:


[root@server ~]# Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
How to start/stop/restart docker service on CentOS7/RHEL7



$ sudo systemctl start docker.service ## <-- Start docker ##
$ sudo systemctl stop docker.service ## <-- Stop docker ##
$ sudo systemctl restart docker.service ## <-- Restart docker ##
$ sudo systemctl status docker.service ## <-- Get status of docker ##
 
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post