Saturday, May 2, 2020

Install Docker Ubuntu | How to install Docker in Ubuntu 22.0.4 | Setup Docker on Ubuntu

Please find steps needed for installing Docker in Ubuntu 22.0.4 instance. You can install in Docker in many ways. But try only one option.

Docker installation steps using default repository from Ubuntu
Update local packages by executing below command:
sudo apt update

Install the below packages
sudo apt install gnupg2 pass -y

gnupg2 is tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures
 
Install docker
sudo apt install docker.io -y

Add Ubuntu user to Docker group
sudo usermod -aG docker $USER

We need to reload shell in order to have new group settings applied. Now you need to logout and log back in command line or execute the below command:
newgrp docker

The Docker service needs to be setup to run at startup. To do so, type in each command followed by enter:

sudo systemctl start docker

sudo systemctl enable docker
sudo systemctl status docker

The above screenshot should confirm that Docker daemon is up and running.

Docker installation steps using Official Docker Repository (Alternative installation steps)

sudo 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"
sudo apt-get update
sudo apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker

now press q to come out this.
ps -ef | grep docker

docker --version

sudo docker run hello-world

the above command should display the below message..

you should see below message 
Hello from Docker!
This message shows that your installation appears to be working correctly.

Setup Docker Registry
Now we need to setup Docker registry. You have one of three options.

Option 1 - DockerHub as Docker Registry
Also, create an account(keep all lowercase in your username)  in the below website for storing docker images in public docker registry..

https://cloud.docker.com/
 
Option 2 - Configure Nexus as Docker Registry
Please click below link to configure Nexus as Docker Registry.
https://www.cidevops.com/2020/02/how-to-configure-nexus-as-docker.html

Option 3 - Configure AWS ECR as Docker Registry
Please click below link to configure Amazon ECR as Docker Registry.
https://www.cidevops.com/2020/05/how-to-setup-elastic-container-registry.html
 
Option 4 - Configure Azure Container Registry
Please click below link to configure ACR in Azure.
https://www.coachdevops.com/2019/12/how-to-upload-docker-images-to-azure.html

Microservices Introduction
Containerization is increasingly popular because containers are:
  • Flexible: Even the most complex applications can be containerized.
  • Lightweight: Containers leverage and share the host kernel.
  • Interchangeable: You can deploy updates and upgrades on-the-fly.
  • Portable: You can build locally, deploy to the cloud, and run anywhere.
  • Scalable: You can increase and automatically distribute container replicas.
  • Stackable: You can stack services vertically and on-the-fly.

No comments:

Post a Comment

DevOps Interview Preparation Useful real time tips | Crack DevOps Interviews | How to clear DevOps Interviews

Are you failing in DevOps Interviews? Are you not be able to next round in the Interview process?  Let's find out how to fix this:   Fir...