How to install Docker in Ubuntu 22.0.4

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-get 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
 
Option 2 - Configure Nexus as Docker Registry

Option 3 - Configure AWS ECR as Docker Registry
 
Option 4 - Configure Azure Container Registry


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.

Comments

Popular posts from this blog

Install Ansible on Ubuntu | How to setup Ansible on Ubuntu 22.0.4 | Ansible install on Ubuntu

Setup build agent/slave VM and Integrate with Jenkins Master

Install SonaType Nexus 3 using Docker Compose