Install Docker engine on a Ubuntu 20.04
You need docker engine to build docker image, run image as a container and so on.
Ref: https://docs.docker.com/engine/install/ubuntu/
-
Remove the old:
BASHsudo apt-get remove docker docker-engine docker.io containerd runcIt’s OK if apt-get reports that none of these packages are installed.
-
Install some lib:
BASHsudo apt-get updatesudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release -
Add Docker’s official GPG key:
BASHcurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg -
Setup stable repository:
BASHecho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt-get update -
Install docker things:
BASHsudo apt-get -y install docker-ce docker-ce-cli containerd.io -
Now, you should be able to:
BASHsudo docker login
Note:
On a Ubuntu you need to install `Docker`
and `docker-compose`
repectively.
To Install `docker-compose`
, just:
-
Download from github with
`curl`
.DOCKERsudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -
Make it executable.
DOCKERsudo chmod +x /usr/local/bin/docker-compose