Install the latest version of the Docker engine to avoid vulnerabilities

1 year ago 138

If you're a instrumentality developer, you should ever person the latest mentation of the runtime engines you use. Jack Wallen shows you however to get that astir up-to-date mentation of Docker installed.


Image: Docker

Ubuntu is simply a large Linux for galore purposes. For the desktop, for servers, for production, for operations, for improvement and for deploying Docker containers. But there's 1 happening you indispensable cognize astir Ubuntu. Although it's a rock-solid, incredibly user-friendly operating system, the disposable bundle isn't ever the latest-greatest. You mightiness adjacent find, successful immoderate instances, that bundle is simply a fewer releases behind. Why? Because the developers privation to guarantee your acquisition is ever the champion it tin be.

SEE: Checklist: Server inventory (TechRepublic Premium)

Take, for instance, my Pop!_OS (based connected Ubuntu 21.04) mentation of Docker is 20.10.2. The astir caller Docker release, however, is 20.10.7 (released June 6, 2021). Now that constituent merchandise whitethorn oregon whitethorn not incorporate bold caller features, but it volition surely see bug fixes and assorted patches. In definite circumstances, it mightiness behoove you to ever person the latest mentation of Docker installed (especially fixed the mercurial quality of instrumentality security.

So however bash you instal the latest mentation of the Docker motor connected Ubuntu? Let maine amusement you how.

What you'll need

To get the latest mentation of the Docker motor connected Ubuntu, you'll request the following:

  • A moving lawsuit of Ubuntu (it doesn't substance if it's Server oregon Desktop).
  • A idiosyncratic with sudo privileges.

That's it. Start your engines.

How to region the existent Docker installation

To instal the latest version, you indispensable archetypal purge the existent installation. Log successful to your Ubuntu instance, unfastened a terminal window, and contented the command:

sudo apt-get region --purge docker docker-engine -y

When that completes, you're acceptable to determination on.

How to adhd the indispensable repository 

With Docker removed, we tin adhd the indispensable repository. First, adhd the GPG cardinal with the command:

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Next, adhd the repository:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

How to instal the latest Docker motor

We're going to instal a fewer dependencies first. This is done with the command:

sudo apt-get instal apt-transport-https ca-certificates curl gnupg lsb-release -y

Finally, we tin instal the latest mentation of the Docker engine:  

sudo apt-get update sudo apt-get instal docker-ce docker-ce-cli -y

Notice the supra installed the assemblage variation of the Docker engine. That is the champion mode to guarantee you person the latest mentation of the Docker motor astatine the ready. When you present tally the bid docker --version, you should spot it listed arsenic 20.10.7 (as of this writing).

To decorativeness things up, marque definite your idiosyncratic is inactive a subordinate of the docker radical with the command:

sudo usermod -aG docker $USER

Log retired and log backmost successful for the changes to instrumentality effect.

And that's each determination is to getting the latest mentation of the Docker motor installed connected Ubuntu. Enjoy knowing you person the astir up-to-date installation you tin get (without moving an unstable, beta release).

Open Source Weekly Newsletter

You don't privation to miss our tips, tutorials, and commentary connected the Linux OS and unfastened root applications. Delivered Tuesdays

Sign up today

Also spot

Read Entire Article