In this lesson, I will show you how to install Docker on a Linux Ubuntu operating system.
Reload Local repository:
sudo apt-get update
Install prerequisite packages:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
Add GPG key of Docker:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Check the key:
sudo apt-key fingerprint 0EBFCD88
Add docker repository to APT:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
Update apt packages and install docker-engine:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Check docker version:
docker --version
Uninstall Docker:
sudo apt-get purge docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker