Video Reference : https://www.youtube.com/watch?v=lqFvoEBHSIQ&t=5s
- Ubuntu Jammy 22.04 (LTS)
- Ubuntu Focal 20.04 (LTS)
- Ubuntu Bionic 18.04 (LTS)
- Uninstall Old Version(If any installed)
Older versions of Docker went by the names of docker, docker.io, or docker-engine. Uninstall any such older versions before attempting to install a new version,
sudo apt-get remove docker docker-engine docker.io containerd runc
- Update & upgrade the system
sudo apt-get update
sudo apt-get -y upgrade
- Install the Prerequisites
sudo apt-get -y install ca-certificates curl gnupg lsb-release
- Set up the repository & Official GPG Key
sudo mkdir -p /etc/apt/keyrings
# Add Official GPG Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set up the repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
- Install Docker Engine
# Install Latest Version
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
OR
# Install Specific Version
# Check list of available versions
apt-cache madison docker-ce | awk '{ print $3 }'
# Specific Version Here
VERSION_STRING=5:20.10.13~3-0~ubuntu-jammy
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-compose-plugin
- Add your user to
docker
group
# Add your user to the `docker` group
sudo usermod -aG docker $USER
- Relogin into system & verfiy that you can run
docker
commands without sudo.
# Relogin
su - ${USER}
# Verify
docker run hello-world
@akshayithape-devops is the docker engine only required for Ubuntu or do we also have to install it windows ?