The Hoof & Paw
DocsCategoriesTagsView the current conditions from the WolfspyreLabs WeatherstationToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Installing Docker on Ubuntu Hosts

Installing Docker on Ubuntu Hosts


Quick navigational links:


This taken from Docker’s instructions for installing Docker

Pre-Requisites

Remove any existing versions

apt-get remove docker docker-engine docker.io containerd runc

Methods

Installing from the repo

Setup the repository

Update and prep

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

1
2
apt-get update
apt-get -y install apt-transport-https ca-certificates curl gnupg lsb-release
  • Add Docker’s GPG key:
1
2
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add the repository to your system
  • Generate and add the apt repo artifact for your architecture:
amd64
Instructions

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

armhf
Instructions

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

arm64
Instructions

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

Install the dockery goodness

Update the apt package index, and install the latest version of Docker Engine and containerd,

1
2
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io

if you wish to be pedantic:

1
apt-get install containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-scan-plugin pigz slirp4netns
To install a specific version

To install a specific version of Docker Engine, list the available versions in the repo, then select and install:

a. List the versions available in your repo:

1
    apt-cache madison docker-ce

b. Install a specific version using the version string from the second column, for example

1
apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io

Installing via a package

convienience script

Custom tweaks

/etc/docker/daemon.json
{ "log-driver": "journald" }

in conjunction with a /etc/systemd/journald.conf config like so:

1
2
3
4
5
6
7
8
9
[Journal]
Storage=volatile
ForwardToSyslog=yes
Compress=no
SystemMaxUse=auto
SystemMaxFileSize=10M
SystemMaxFiles=100
RuntimeMaxFileSize=10M
RuntimeMaxFiles=100