With our Docker Repository all set up, use the following command to update.
sudo apt-get update
If you get a GPG error when trying to run the previous command, use this command to fix it before re-trying the update.
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Now we're ready to install Docker. Use the following command to do so:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
After the installation process is complete, confirm that Docker installed properly by testing this hello-world function.
sudo docker run hello-world
When you see this screen, you'll have completed these steps successfully.