How to install Docker on CentOS 7 /RHEL 7/Ubuntu 16.04 step by step guide



Install Docker in Ubuntu 16.04 / 18.04 LTS /CentOS 7/ RHEL 7 |In this tutorial we learn what is docker and how to install Docker on CentOS 7,RHEL 7 and Ubuntu 16.04 / 18.04.

What is Docker?

Docker is container service management. Docker is open source lightweight tool which allow us to create ,ship and run an application on isolated container. Developing task became easy for developer for docker because they only focus on coding.   

Docker Engine is important component for docker which is building the images and creating the container.

How to install Docker on CentOS 7 /RHEL 7

Docker package is available in the centos extra repository. you can install Docker package using the below command.

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



Install Docker in Ubuntu16.04/18.04

Docker package is available in ubuntu by default. To install Docker In Ubuntu 16.04 / 18.04 LTS we need to execute below command .There is no need to install extra repository like centos and redhat and oracle also.



# apt-get install docker -y

After installed the Docker package we need to start the docker service and enable the service at startup mode execute the below command.


 [root@localhost ~]#systemctl start docker
[root@localhost ~]#systemctl enable docker

After doing the above steps we can check the docker service status using the below command.

[root@localhost ~]#systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-01-17 22:18:43 IST; 12s ago
     Docs: http://docs.docker.com
 Main PID: 2324 (dockerd-current)
   CGroup: /system.slice/docker.service
           ─2324 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/lib...
           └─2328 /usr/bin/docker-containerd-current -l unix:///var/run/docke...

To know the Docker version and info

To know the docker version and docker info we need to execute the below command.
[root@localhost ~]#docker version
How to install Docker on CentOS 7 and RHEL 7  step by step guide,Install Docker in Ubuntu16.04
How to install Docker on CentOS 7 /RHEL 7/Ubuntu 16.04
And get the docker info run the below command.

[root@localhost ~]#docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.13.1
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Init Binary: /usr/libexec/docker/docker-init-current

Verify Docker working or not on CentOS 7 and RHEL 7 and Ubuntu 16.04 /18.04

To verify Docker is working or not we can run test container image using the below command  and if you will get this below message then docker works correctly on your system.
[root@localhost ~]# docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.

To get full list of docker command we can execute the command on the terminal.
[root@localhost ~]# docker
That’s all.If this article is helpful to know about Install Docker in Ubuntu16.04 / 18.04 ,CentOS 7/ RHEL7 please share it!!!

SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment