Installation Docker and Basic Commands on Centos 7 – Part 1

How To Install Docker


Docker is a container management service The whole idea of Docker is that developers can easily develop programs, export them to containers that can be distributed anywhere.

Install docker on VM
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Add repo
$ sudo yum-config-manager --add-repo
Install docker
[root@fosnix ~]# yum install docker

After the Docker package installed, start the daemon, check its status and enable it on a comprehensive system using the instructions below:

[root@fosnix ~]# systemclt start docker
[root@fosnix ~]# systemctl status docker
[root@fosnix ~]# systemctl enable docker

Finally, run a container test image to verify if Docker works properly, by issuing the following command:

[root@fosnix ~]# docker run hello-world

If you can see the below message, then everything is in the right place

Now, check the current images 

[root@fosnix ~]# docker images

Now, you can run a few basic Docker commands to get some info about Docker:

[root@fosnix ~]# docker info

The first important task when working with Docker containers is to know your Docker version, use the command to know your Docker version

[root@fosnix ~]# docker version

To get a list of all available Docker commands type docker on your console.

[root@fosnix ~]# docker
Download a Docker Image

In order to start and run a Docker container, you first have to Downloaded the image from Docker Hub into your host. The Docker Hub offers many free images from its shelters.

To search for a Docker image, for example, Ubuntu, perform the following command:

[root@fosnix ~]# docker search ubuntu

After you’ve decided which image you want to use based on your needs, download it by launching the command below in this case for an Ubuntu image downloaded and used.

[root@fosnix ~]# docker pull ubuntu

To list all the available Docker images on your host issue the following command:

[root@fosnix ~]# docker images

If you don’t need a Docker image anymore and you want to remove it from the host issue the following command:

[root@fosnix ~]# docker rmi ubuntu

First, Click on Advance then scroll to bottom and click on proceed :
The Output is as shown below:


No responses yet

Leave a Reply

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

Latest Comments

No comments to show.