Since I wrote this, there are at least two new versions: the snap version (sudo snap install docker
), which works well but isn't the latest and does not support all the bells and whistles that the Docker Desktop supports.
Depending on your needs, you can just use the default Ubuntu version:
apt-get install docker.io
The list of available packages is:
$ apt-cache search docker
[...snip...]
docker - transitional package
docker-clean - simple Shell script to clean up the Docker Daemon
docker-compose - define and run multi-container Docker applications with YAML
docker-doc - Linux container runtime -- documentation
docker-registry - Docker toolset to pack, ship, store, and deliver content
docker.io - Linux container runtime
[...snip...]
The main issue with that method is that you are likely to get a somewhat older version. Once an Ubuntu OS is released, the version of most packages does not change. You only get important CVE and other security fixes. This is because it's very complicated to upgrade to a newer version without possibly breaking many other parts of the system (i.e. incompatible libraries, code could SEGV, etc.) Gentoo's way of doing things, to avoid this issue, is to recompile everything (all dependencies).
So instead Docker offers a way to install their latest version. That means you access their own package repository and in order to do that you have a few more steps to set it up on your machine. This includes adding the repository info to your system. apt-get
on its own would not be able to find all the data.
So, if you need the newest version of Docker with all the bells and whistles, you want to follow those 7 steps (and as mentioned, you can write a script, or even better, download the script from the Docker website). Otherwise, you could just install the version coming with your Ubuntu OS.
As a side note, for Java, Oracle uses a different approach, which is to have a small package which downloads the latest of whatever version. That's a rather complicated method on them since, in their case, they pretty much replace all the logic offered by dpkg
(and thus apt-get
).