Docker is an open source project that helps people to run and manage containers. For developers, Docker helps in different stages of the development lifecycle.
During the development phase, Docker enables developers to spin up different infrastructure services such as databases and service discoveries like Consul without installation in the current system operational. It helps the developers because developers do not need to install these kinds of systems in the operating system layer. Usually, this task can cause conflicts with the libraries during the installation process and consumes a lot of time.
Sometimes, developers need to install the exact version. In this case, it is necessary to reinstall the whole application on the expected version. It is not a good thing because the developer machine during this time becomes slow. The reason is quite simple, there are many applications that are used during software development.
Docker helps developers at this stage. It is quite simple to run a container with MongoDB. There is no installation and it enables developers to start the database with one line. Docker supports the image tag. This feature helps to work with different versions of the software; this is awesome for developers who need to change the software version every time.
Another advantage is that when the developers need to deliver the artifacts for test or production purposes, Docker enables these tasks via Docker images.
Docker helps people to adopt the DevOps culture and delivers amazing features to improve the performance of the whole process.
Let's install Docker.
The easiest way to install Docker is to download the script found at https://get.docker.com:
curl -fsSL get.docker.com -o get-docker.sh
After the download is completed, we will execute the script as follows:
sh get-docker.sh
Wait for the script execution and then check the Docker installation using the following command:
docker -v
The output needs to look like the following:
Sometimes, the version of Docker can be increased, and the version should be at least 17.10.0-ce.
Finally, we will add the current user to the Docker group, and this enables us to use the Docker command line without the sudo keyword. Type the following command:
sudo usermod -aG docker $USER
We need to log out to effect these changes. Confirm whether the command works as expected by typing the following. Make sure that the sudo keyword is not present:
docker ps
The output should be as follows: