Install Docker and Docker Compose on Linux Mint 19

Posted on 134 views

How can I install Docker CE on Linux Mint 19?, How can I install Docker Compose on Linux Mint 19?. This guide will answer above questions by showing you a step by step installation of Docker and Docker Compose on Linux Mint 19.

Docker has been the defacto container engine since its arrival. It enables you to package and run your applications in isolated containers within a single host or cluster of Linux hosts.

Docker Engine is available in Community Edition (CE) and Enterprise Edition (EE). In this guide, we will do the installation of Docker Community Edition on Linux Mint 19 using below steps.

Step 1: Install Dependency packages

Start the installation by ensuring that all the packages used by docker as dependencies are installed.

sudo apt update
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common
sudo apt -y remove docker docker-engine docker.io containerd runc

Step 2: Add Docker’s official GPG key

Import Docker GPG key used for signing Docker packages.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 3: Add the Docker repository to Linux Mint 19

Add Docker upstream repository to your Linux Mint 19 so you can install the latest stable release of Docker.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

The command above will add a new line to additional repositories file.

$ cat /etc/apt/sources.list.d/docker.list
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu bionic stable

Step 4: Install Docker Engine and Docker Compose in Linux Mint 19

Update the apt package index.

$ sudo apt update
Hit:1 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                        
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease                     
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease              
Ign:5 http://packages.linuxmint.com tessa InRelease                            
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                
Get:7 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]      
Hit:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease              
Hit:9 http://packages.linuxmint.com tessa Release                              
Get:11 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [3,695 B]
Fetched 68.1 kB in 2s (33.9 kB/s)
Reading package lists… Done

Then install the latest version of Docker CE and Docker Compose

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

The docker group is created but no users are added. Add your normal user to the group to run docker commands as non-privileged user.

sudo usermod -aG docker $USER
newgrp docker

Check the version of docker installed

$ docker version
Client: Docker Engine - Community
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        dea9396
 Built:             Thu Nov 18 00:37:08 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:35:16 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Run a test docker container:

$ docker run --rm -it  --name test alpine:latest /bin/sh
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
cd784148e348: Pull complete 
Digest: sha256:46e71df1e5191ab8b8034c5189e325258ec44ea739bba1e5645cff83c9048ff1
Status: Downloaded newer image for alpine:latest

 / # cat /etc/os-release 
 NAME="Alpine Linux"
 ID=alpine
 VERSION_ID=3.15.0
 PRETTY_NAME="Alpine Linux v3.15"
 HOME_URL="http://alpinelinux.org"
 BUG_REPORT_URL="http://bugs.alpinelinux.org"
 / # exit

Install Docker Compose on Linux Mint 19

On Linux Mint 19, Docker Compose can be installed with the following guide:

You now have Docker Engine and Docker Compose installed on Linux Mint 19. Enjoy using containers to run your services.

Also relevant is Top command for container metrics

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.