In the case of Linux, there are numerous ways that an app can be enjoyed. That can bring a lot of confusion and issues. For example, Debian, Ubuntu and other Debian/Ubuntu-based distros like Linux Mint use DEB packages as installable apps. For CentOS and RHEL, it’s RPM.
When a dev is working on an app, he has to keep that in mind. The fact that different Linux ecosystems work differently puts a hefty amount of stress on the development process. Why?
Let’s make things clear with an example. You generally can’t run a package that’s built for Debian/Ubuntu ecosystem on any other systems like CentOS and RHEL. The opposite is also true. The problem can be avoided using various techniques. But at the enterprise level, there has to be something that makes this type of action really easy.
This is where Docker comes into play. There are also other ways of enjoying universal Linux apps like snap. Learn how to use snap packages on Ubuntu and Ubuntu-based distros.
What Docker is
So, what is Docker? Docker is a special tool that’s designed especially for easier creation, deployment, and running Linux apps using “containers”. In Docker’s terms, “containers” are a pre-bundled environment where Linux apps can run in an expected and repeatable fashion. The containers come up with all the essential resources (libraries and other dependencies). This allows the same container to run on every supported Linux platform.
As you can guess, this makes things A LOT easier for the developer. Being free from the concern of portability, devs can focus fully on the app itself and make it way better.
In a sense, Docker works like a virtual machine. However, it’s significantly different at the core level. In the case of virtualization, the “guest” environment is created on top of the “host”. However, in the case of Docker, containers are allowed to access hardware resource directly via the host’s kernel, especially on the Linux systems. In addition, only those packages that are not available on the “host” system is packed inside Docker. Both of these features together offer a huge boost in both performance and the size of each containers (smaller and lighter).
So, why use Docker? It’s open-source with a HUGE community behind it. It has already found its place in the professional workspace. It’s also possible to extend the features of Docker to meet anyone’s needs and add additional features that don’t arrive out-of-the-box.
However, for developing a Docker container, the security has to be ensured. Docker offers quite good security measurements for apps running in such a shared environment. However, containers, by themselves, aren’t an alternative to taking full-fledged security measures.
Who is Docker for?
Docker is a tool that’s meant to benefit the full set of modern IT and software development professionals including the newish field of DevOps.
For software developers, Docker is a big relief. There’s no more necessary for worrying about cross-platform compatibility. With thousands of already-available apps, developers can get a head start in their Docker container development.
For operations and staff, Docker offers the ultimate flexibility. It potentially reduces the number of systems necessary. Docker itself creates only a small footprint and lower overhead.
Getting Docker on Linux Mint
For Linux devs/users, Docker can become an integral part. Using Docker, it’s possible to perform seemingly impossible tasks with ease.
In the case of Linux Mint, let’s get Docker ready!
Installing Docker from repo
Note – I’ll be installing Docker CE (Community Edition) for the guide. It’s free and open-source with extreme flexibility for both developers and small teams. For getting started with Docker, Docker CE is the best spot.
At first, it’s STRONGLY recommended to make sure that there’s no version of Docker installed previously.
It’s completely okay to have none of these packages installed previously.
Make sure that APT cache is up-to-date.
By default, APT doesn’t use HTTPS. Install the following packages that will allow APT to use a repository over HTTPS.
For enabling the Docker repo, the official Docker key is important. Time to add the official GPG key of Docker into the APT keyring.
Even after the successful addition of the key, it’s safe to verify the key. Run the following command –
In the case of Docker, there are 3 different repositories – “stable” (recommended for everyone), “nightly” or “test”. Let’s configure the “stable” repo.
Note – If you wish to configure any other repo (nightly or test), just change the “stable” from the command into “nightly” or “test” (without quotes).
Once the repositories have been added, it’s necessary to refresh the APT cache again.
Finally, install the latest version of Docker CE and containerd.
If you’re interested in a certain version of Docker CE, then follow the following procedures.
Run the following command for listing all the available versions –
Once you’ve made your mind, time to install that version! Run the following command –
Here, the <VERSION_STRING> should be replaced with something like “18.06.0~ce~3-0~ubuntu” (without quotes).
Installing Docker using DEB
Docker is also kind enough to provide an installable DEB package for Debian, Ubuntu and derivatives.
Get Docker CE DEB package for Linux Mint.
Note – In my case (Linux Mint 19.1 Tessa, based on Ubuntu 18.04 Bionic), I have to choose Bionic. Depending on your Linux Mint version, this may differ. Check out all the available package base for Linux Mint.
Go to pool >> stable.
Now, download the latest versions of containerd and docker-ce-cli or docker-ce.
Install them using APT –
sudo apt install ./*.deb
Verifying Docker installation
Run the following command from a terminal –
According to the message, this command is the surefire way of verifying a successful Docker installation.