Docker is an open source tool, designed to create, deploy and run applications easily and quickly by using containers. It packages, provisions and runs containers independent of the OS. It is developed in Go language.
Containers allows packaging an application with all the libraries, configuration files and dependencies as one single image. This helps the developers to be rest assured that the application will run on any other machine regardless of settings that the machine might have that could differ from the machine used for writing and testing the code.
Docker use kernel of the host system on which the applications are running. It shares the services of underlying operating system. This gives a significant performance boost and reduces the size of application.
Docker was created to work on Linux platforms. However, non-linux operating systems like Microsoft Windows and Apple OS X are also supported. Versions for Amazon Web Services (AWS) and Microsoft Azure is also available.
In this tutorial, let us see how to install community version of Docker from its repository as well as from its package, on CentOS.
centos-extras repository must be enabled. This repository is enabled by default, but if you have disabled it, you need to re-enable it.overlay2 storage driver is recommended.yum-utils provides the yum-config-manager utility and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver needed by Docker.yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce
systemctl start docker
running state.systemctl status docker
hello-world image.docker run hello-world
docker --version
wget. If wget is not availble, install it using yum.yum install -y wget
.rpmfile for the needed Docker version using wget. (Since I need Docker version 17.12.0-ce in have downloaded docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm)wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
yum localinstall docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
systemctl start docker
running state.systemctl status docker
hello-world image.docker run hello-world
docker --version
If you have any questions or comments, I'd would love to hear from you in comment section.