How to Install Docker on Linux Mint

Docker is an open-source platform to streamline the development, shipment, and deployment of the software. Docker is a cross-platform utility and is widely used in the software developers’ community around the globe.

Docker allows you to package and run a software application in a container (Docker container). A Docker container comprises all the essentialities for software, such as; source code, tools, libraries, or any settings. Moreover, Docker provides the continuous integration of the software modules at the development time.

This descriptive post demonstrates several methods to install Docker on Linux Mint.

How to Install Docker on Linux Mint

Docker can be installed from the official repository of Linux Mint using the Docker snap and the .deb package of Docker. To better understand, we have divided this installation guide into various sub-sections to demonstrate each method separately.

How to Install Docker on Linux Mint Using the Official Repository of Linux Mint

You need to follow various steps to get Docker from Linux Mint’s official repository:

Step 1: Firstly, update the system packages of Linux Mint by issuing the following command:

$ sudo apt update

Step 2: After updating the core libraries of Linux Mint, you can install the latest Docker from the Linux Mint repository via the following command:

$ sudo apt install docker*

The command will install Docker and its dependencies, as seen in the output.

Verify the installed version of the Docker as follows:

$ docker --version

How to Install Docker on Linux Mint Using the Debian Package

Linux Mint is the derivative of the Debian-based distributions of Linux. The Debian package of Docker can also be used to install Docker on Linux Mint.

Step 1: Download the Debian package of Docker-ce-cli.deb, containered.io.deb, and docker-ce.deb with the help of the following commands:

– For containerd.io :

$ wget  https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/containerd.io_1.6.4-1_amd64.deb

– For docker-ce-cli:

$ wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce-cli_20.10.15~3-0~ubuntu-focal_amd64.deb

– For docker-ce:

$ wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce_20.10.15~3-0~ubuntu-focal_amd64.deb

Step 2: The files can be traced inside the current directory. Now, you can install all three “.deb” files present in the Downloads directory via the following command:

$ sudo apt install ./*.deb

You can verify the installation by issuing the below-mentioned command:

$ sudo docker version

Step 3: If you want to execute the docker commands with the non-root user, you must add the user to the docker group by issuing the below-mentioned command:

$ sudo usermod -aG docker $USER

After adding the current user to the docker group, you can use the docker commands without root privileges (for only currently logged-in user):

$ docker version

How to Install Docker on Linux Mint Using the Snap

The snap support is available on several Linux distributions to install packages using the terminal and the graphical user interface. The following steps are recommended to follow to install Docker on Linux Mint using the snap:

Step 0 (Optional): You need to enable the snap packages installation. Firstly, move/remove the “/etc/apt/preferences.d/nosnap.pref” file to allow installing snaps installation on your system. It is recommended to move the directory to some other location on the device as we did:

$ sudo mv /etc/apt/preferences.d/nosnap.pref ~/Downloads

Now, install snapd by using the below-mentioned command:

$ sudo apt install snapd

Note: Step 0 is optional and can be skipped if you have already enabled the snapd service.

Step 1: Once the initial step is performed, then Docker can be installed using the following snap command:

$ sudo snap install docker

The installation can be verified by issuing the below-mentioned command:

$ docker --version

How to Remove Docker From Linux Mint

If the Docker is installed from the official repository, then you can use the following command to remove Docker and all its dependencies from Linux Mint:

$ sudo apt autoremove docker* --purge

However, if you have installed Docker from the snap store, then it can be removed via the below-mentioned command:

$ sudo snap remove docker

After doing so, Docker will be removed from the Linux Mint.

Conclusion

Docker is an open-source and cross-platform utility for software developers. Docker container integrates source code of applications with the libraries/dependencies of the Operating System. This article demonstrates the installation of Docker on Linux Mint using three different methods. You have learned to install Docker on Linux Mint: from the official repository of Linux Mint, using the Docker snap and the Debian package of Docker. We have also illustrated various ways to remove Docker from Linux Mint.



from https://ift.tt/XC6ZEGg

Post a Comment

0 Comments