maya's blog

About programming, aws and ubuntu

Install Docker CE for Ubuntu

docs.docker.com

How to install Docker CE to Ubuntu?

Setup the repository

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker CE

sudo apt-get update
sudo apt-get install docker-ce
apt-cache madison docker-ce  # show list the available version
sudo apt-get install docker-ce=5:18.09.4~3-0~ubuntu-cosmic docker-ce-cli=5:18.09.4~3-0~ubuntu-cosmic containerd.io  # install 5:18.09.4~3-0~ubuntu-cosmic version

Setup to use Docker as non-root user

sudo usermod -aG docker <your-user>

So reboot.

Test

sudo docker run hello-world