In this blog, I will guide you through the process to install Docker in simple steps. In case you are not acquainted with Docker, don’t forget to check out this blog. Installing docker is just a piece of cake, you just need to run few commands and you’re done!
In this Install docker blog, you will learn:
So, let’s get started by first installing Docker on Ubuntu operating system.
Step 1: To install docker on Ubuntu box, first let us update the packages.
sudo apt-get update
This will ask for the password. Refer to the below screenshot to get a better understanding.
Step 2: Now before installing docker, I need to install the recommended packages. For that, just type in the below command:
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
Press “y” to continue.
After this, we are done with the pre-requisites! Now, let’s move ahead and install Docker.
Step 3: Type in the below command to install docker engine:
sudo apt-get install docker-engine
Sometimes it will ask again ask for the password. Hit enter and the installation will begin.
One this is done, your task to install docker will be completed!
Learn Devops From Experts
Step 4: So let’s just simply start the docker service. For that, just type in the below command:
sudo service docker start
It says your job is already running. Congratulations! docker has been successfully installed.
Step 5: Now just to verify that docker is successfully running, let me show you how to pull a CentOS image from docker hub and run the CentOS container. For that, just type in the below command:
sudo docker pull centos
First, it will check the local registry for CentOS image. If it doesn’t find there, then it will go to the docker hub and pull the image. Refer to the below screenshot for better understanding:
So we have successfully pulled a centOS image from docker hub. Next, let us run the CentOS container. For that, just type in the below command:
sudo docker run -it centos
As you can see in the above screenshot, we are now in the CentOS container!
So to summarize, We have first installed docker on Ubuntu, after that we have pulled a CentOS image from docker hub and using that image, we have successfully built a CentOS container. To know more about docker containers and how it works, you can refer this blog on Docker Container.
This is how you install docker and build a container on Ubuntu.
View Upcoming Devops Batches
To install docker on your CentOS machine, I would suggest you to go through this docker installation video. This Edureka Docker Installation Tutorial will help you to learn how to install Docker on a CentOS operating system and how to run a Docker container using Docker Run command. Go ahead, enjoy the video and tell me what you think.