Docker Installation – Part 2

Can be installed on both Linux and Windows. Here in this blog I am installing docker engine on ubuntu ec2 instance. Commands will be different for different OS. Official documentation of docker is as below:

https://docs.docker.com/

sudo apt-get remove docker docker-engine docker.io containerd runc -y

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent     software-properties-common -y

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable" -y

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io -y

Docker would be running as a service on the machine. So as to check if it is working fine, execute the command

sudo systemctl status docker

As of now we are running these commands from a ubuntu user who is having sodoers permission. So as our ubuntu user can directly run the docker commands, let’s add the ubuntu user to the docker group in /etc/group

No alt text provided for this image

Now you should be able to run docker commands like docker images, docker ps and many more easily.

About the author

Deepak Sood

Deepak Sood is Lead Consultant in an IT firm holding expertise in Devops and QA Architecture with 8 years of experience.

His expertise is in building highly scalable frameworks. His skills include Java, Configuration Management, Containers, and Kubernetes.

Reach out to him using contact form.

View all posts