Install Docker Engine for Linux

As I always say, the difference between a good engineer and a SME is repetitions.  Already in this back to basics series, we’ve covered Git, GitHub, and YAML files.  Now comes time to get familiar with Docker containers.  The best way to do this is to build your own lab.  There are a few ways you can do this: 1. buy servers and put them in your lab but can be pricey 2. buy a decent spec laptop and either install linux/windows. 3. use something like VMware workstation to embed a lab.  In any case, my preference is to still use linux and this article will walk you through setting up Docker engine after you have a linux environment stood up.

For my windows people out there:

For those of you who wish to skip the manual install process and use the automated script version please go here:

Future link coming soon

Step by step process:

Screenshot from the Install Docker Engine on Linux walkthrough at step 1, showing docsdockercom; the adjacent article text explains that the author uses the search bar.

I use the search bar

Screenshot from the Install Docker Engine on Linux walkthrough at step 2, showing Get Docker; the adjacent article text explains that the author uses the search bar.

Get Docker

Screenshot from the Install Docker Engine on Linux walkthrough at step 3, showing W docker docs; the adjacent article text explains that docker for Linux.

Docker for Linux

Screenshot from the Install Docker Engine on Linux walkthrough at step 4, showing Docker Engine; the adjacent article text explains that docker for Linux.

Pick your flavor of linux – I will be using Ubuntu

Screenshot from the Install Docker Engine on Linux walkthrough at step 5; the adjacent article text explains that pick your flavor of linux - I will be using Ubuntu.

Now begins a copy and paste job

Screenshot from the Install Docker Engine on Linux walkthrough at step 6; the adjacent article text explains that begins a copy and paste job.

$ lsb_release -a

$ cat /etc/*release*

Two ways to confirm your version of linux so you download the correct file

Screenshot from the Install Docker Engine on Linux walkthrough at step 7, showing Uninstall old versions; the adjacent article text explains that two ways to confirm your version of linux so you download the correct file.

#sudo apt-get remove docker docker-engine docker.io containerd runc

This will uninstall any old versions of docker that may have already been downloaded as part of your base OS install

Screenshot from the Install Docker Engine on Linux walkthrough at step 8, showing Install using the repository; the adjacent article text explains that this will uninstall any old versions of docker that may have already been downloaded as part of your base OS install.
Screenshot from the Install Docker Engine on Linux walkthrough at step 9, showing $ sudo apt-get update; the adjacent article text explains that $sudo apt-get update.

$sudo apt-get update

Time for a quick update

Screenshot from the Install Docker Engine on Linux walkthrough at step 10; the adjacent article text explains the apt-get install command for transport, certificate, curl, GnuPG agent, and common software packages.

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Screenshot from the Install Docker Engine on Linux walkthrough at step 11; the step instructs the user to add Docker’s official GPG key:$ curl -fsSL | sudo apt-key add.

Add Docker’s official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

Screenshot from the Install Docker Engine on Linux walkthrough at step 12; the step instructs the user to add Docker’s official GPG key:$ curl -fsSL | sudo apt-key add.
Linux terminal showing the Docker APT repository being added and package indexes downloaded from the Ubuntu and Docker repositories.

$ sudo add-apt-repository \
   “deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable”

Screenshot from the Install Docker Engine on Linux walkthrough at step 14, showing INSTALL DOCKER ENGINE; the step instructs the user to add Docker’s official GPG key:$ curl -fsSL | sudo apt-key add.
Screenshot from the Install Docker Engine on Linux walkthrough at step 15, showing i$ sudo apt-get update; the adjacent article text explains that $ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io.

 $ sudo apt-get update
 $ sudo apt-get install docker-ce docker-ce-cli containerd.io

Screenshot from the Install Docker Engine on Linux walkthrough at step 16, showing $ sudo docker run hello-world; the adjacent article text explains that $ sudo docker run hello-world.

$ sudo docker run hello-world

Summary:
As you can see there are a few steps in deploying Docker manually.  I always like to go through things manually once prior to using a script.  As always, I hope y’all found this useful.

Keep exploring

Choose your next step

Continue with the path that best matches the architecture or operating challenge in front of you.

Leave a Reply

Discover more from Digital Thought Disruption

Subscribe now to keep reading and get access to the full archive.

Continue reading