What is Docker?
Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.
What is Docker Container
A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application.
Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space.
Lets start the Docker Installation on Ubuntu
Step 1:Update and install the system dependencies before install docker
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg -y
Step 2: Add GPG (GNU Privacy Guard) key is used to ensure the authenticity of the packages that are being downloaded from Docker
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 3: Now we start install Docker & Docker plugins
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- InstallDocker-Compose Plugins
curl -L "https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
ls -lsh /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- Verify the Docker & Docker compose version
docker version && docker-compose version
- Restart,enable the Docker service
sudo systemctl restart docker
sudo systemctl enable docker
- Check the status of Docker service
sudo systemctl status docker
Step 4: Create a Docker Group and add user to the group
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
Finally Docker Engine Installation was successfully completed
Top comments (0)