How to Install Docker Engine (Not a Legacy Version!) on Ubuntu Bionic or Focal

In some cases, you may get stuck due to docker and docker compose version.
Let's follow up on docker official documentation:

1apt remove docker docker-engine containerd runc    # purging the legacy version if exists
2apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
3curl -fsSL | apt-key add -
4apt-key fingerprint 0EBFCD88
5add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
6apt update && apt install docker-ce docker-ce-cli

Very awesome! What about the docker-compose which is a pretty cool stuff?

1curl -L "$(uname -s)-$(uname -m)" -o docker-compose
2chmod +x docker-compose
3echo $PATH
4mv docker-compose /usr/sbin/    # In case Bionic or Focal

You should be eager to run docker as a non-root user!

1sudo groupadd docker
2sudo usermod -aG docker $USER
3sudo reboot -h now

Very cool!
Happy dockerizing gents! ๐Ÿ˜Ž

comments powered by Disqus