Show Menu

Docker on Ubuntu 20.04 Cheat Sheet (DRAFT) by

Docker on Ubuntu 20.04

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Installing Docker

1- Update

$ sudo apt update

2- Require

$ sudo apt install apt-tr­ans­por­t-https ca-cer­tif­icates curl softwa­re-­pro­per­tie­s-c­ommon

3- Add GPG key

§ curl -fsSL https:­//d­own­loa­d.d­ock­er.c­om­/li­nux­/ub­unt­u/gpg | sudo apt-key add -

4- Add the repo

$ sudo add-ap­t-r­epo­sitory "deb [arch=­amd64] https:­//d­own­loa­d.d­ock­er.c­om­/li­nux­/ubuntu focal stable­"

5- Check source repo

§ apt-cache policy docker-ce

6- Install Docker:

§ sudo apt install docker-ce

Installing Docker Compose

1- Download the 1.27.4

$ sudo curl -L "­htt­ps:­//g­ith­ub.c­om­/do­cke­r/c­omp­ose­/re­lea­ses­/do­wnl­oad­/1.2­7.4­/d­ock­er-­com­pos­e-$­(uname -s)-$(­uname -m)" -o /usr/l­oca­l/b­in/­doc­ker­-co­mpose

2- Next, set the correct permis­sions so that the docker­-co­mpose command is execut­able:**

$ sudo chmod +x /usr/l­oca­l/b­in/­doc­ker­-co­mpose