Wiki Table of Contents

Docker

This document was prepared by user fehlix to guide users through the installation of Docker.

Setup Docker repository

Get Docker repository key

wget -O docker.gpg  https://download.docker.com/linux/debian/gpg 

Verify Docker public KeyID : 0x8D81803C0EBFCD88
Manually:

gpg   --keyid-format 0xlong docker.gpg 2>/dev/null
pub   rsa4096/0x8D81803C0EBFCD88 2017-02-22 [SCEA]
      9DC858229FC7DD38854AE2D88D81803C0EBFCD88
uid                             Docker Release (CE deb) <[email protected]>
sub   rsa4096/0x7EA0A9C3F273FCD8 2017-02-22 [S]

Add Docker repo-key to apt’s keyring
Check public-key and add to apt trusted keyring:

gpg  --keyid-format 0xlong docker.gpg 2>/dev/null | grep -sq 0x8D81803C0EBFCD88 && sudo apt-key add docker.gpg

Add Docker repository to apt’s sources.list

# For MX 21:
CODENAME=bullseye
# For MX 19 : 
CODENAME=buster
# For MX 18 : 
CODENAME=stretch
echo "deb [arch=amd64] https://download.docker.com/linux/debian $CODENAME stable" | sudo tee /etc/apt/sources.list.d/docker.list

Refresh package lists:

sudo apt update

Simulate to check docker installation

sudo apt --simulate install docker-ce
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  containerd.io docker-ce-cli
Recommended packages:
  aufs-tools cgroupfs-mount | cgroup-lite pigz
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli
0 upgraded, 3 newly installed, 0 to remove and 50 not upgraded.
Inst containerd.io (1.2.6-3 Docker CE:stretch [amd64])
Inst docker-ce-cli (5:19.03.1~3-0~debian-stretch Docker CE:stretch [amd64])
Inst docker-ce (5:19.03.1~3-0~debian-stretch Docker CE:stretch [amd64])
Conf containerd.io (1.2.6-3 Docker CE:stretch [amd64])
Conf docker-ce-cli (5:19.03.1~3-0~debian-stretch Docker CE:stretch [amd64])
Conf docker-ce (5:19.03.1~3-0~debian-stretch Docker CE:stretch [amd64])

Install docker

sudo apt install docker-ce

21 thoughts on “Docker”

  1. This is what I get when I attempt to do this:

    wget -O docker.gpg https://download.docker.com/linux/debian.gpg
    –2020-03-19 19:18:57– https://download.docker.com/linux/debian.gpg
    Resolving download.docker.com (download.docker.com)… 13.35.126.45, 13.35.126.76, 13.35.126.16, …
    Connecting to download.docker.com (download.docker.com)|13.35.126.45|:443… connected.
    ERROR: The certificate of ‘download.docker.com’ is not trusted.
    ERROR: The certificate of ‘download.docker.com’ doesn’t have a known issuer.

    Got Docker running after installing package from MX Package Installer. Can get version by entering command on terminal. But, will not connect to dockerhub because of this certificate issue. Pulling up
    the docker sites on browser, says has perfectly good certificate. Have put in proxy info in two places, and
    seems to be going through the proxy alright but hits the certificate problem. Trying to follow the instructions in this article, run into brick wall on certificates.

    Is there away to get around this block?
    thanks

    Reply
  2. I get a hashsum mismatch error:
    Docker is so popular, u should normally just do sudo apt-get install docker-ce and thats it …

    Err:3 https://download.docker.com/linux/debian buster/stable amd64 docker-ce amd64 5:19.03.8~3-0~debian-buster
    Hash Sum mismatch
    Hashes of expected file:
    – SHA512:6157183c1f4472b24bb3fd8ddce4e659e4f69752496fd5287733d328865cf17abd812779e23ef000d3c705cbb6ddf3cfee5d23b175bd8b4be495bc6f75198f32
    – SHA256:aab5e08d0086ae6d0824e4286f2de160472c4206425105a68eb1bfdfc1f11ef3
    – SHA1:369de6e19806b1501df61fc8cdfda6e1ac89cce3 [weak]
    – MD5Sum:579f11f3582e2d527bf44fbf1775636a [weak]
    – Filesize:22863938 [weak]
    Hashes of received file:
    – SHA512:62aa75fa4f1223693771be1787bfcf685fe9ac10193a73f9af0faef2d5e60ba7315369b66570a6735aa3492ba078ffb8975a3c639e0d1f38f587790928a2d1ff
    – SHA256:e2801b52b1490b62937d6f01b6605f38b6edf8be3bea9e25c5ff2ea096370f2e
    – SHA1:4e2ef3334d51d0901c4d3c695771550e50628972 [weak]
    – MD5Sum:ef7582b03481c37997520afc901ef77b [weak]
    – Filesize:22863938 [weak]
    Last modification reported: Wed, 11 Mar 2020 19:47:08 +0000
    Fetched 83.1 MB in 15s (5,673 kB/s)
    E: Failed to fetch https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64/containerd.io_1.2.13-1_amd64.deb Hash Sum mismatch
    Hashes of expected file:
    – SHA512:e0f8eb0ed3bd881bf5f278f3736da3e4fb05410014a0103301c135a33061945e013bcf8a9cd704d9d6b4fa088d478ebea27e86e466889d0194a8cbb77e94efdf
    – SHA256:a4f244216e54a8a47f2dc5c57acb4cb48a779c54a8588ea2d55c40a57092baf6
    – SHA1:90611afda0acabae485f871b09e4c1eba0ac4dc0 [weak]
    – MD5Sum:78a039cf82b1bd4a285114bdd030982e [weak]
    – Filesize:20114318 [weak]
    Hashes of received file:
    – SHA512:b4a3dbc3c14040d34a102a761201f216d69995b5efc4bb3120844e8ed0811ebf1f468ed96ee61026d27f0690841cb8e90b925ab436d87ca01c64478ea374f27a
    – SHA256:518b0dd7c0d70610bb040e0a671bb95d8a6550b6fadb5c3b7c336e6a2e3c1158
    – SHA1:55997991b0143f803fc66ccd2aad13484197d3d7 [weak]
    – MD5Sum:0a432ca47295af539858273f640dac3b [weak]
    – Filesize:20114318 [weak]
    Last modification reported: Tue, 03 Mar 2020 04:24:01 +0000
    E: Failed to fetch https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64/docker-ce-cli_19.03.8~3-0~debian-buster_amd64.deb Hash Sum mismatch
    Hashes of expected file:
    – SHA512:12e1ec1431736bfe7046b4f809ef144a0ae4043bd93ed16972d2b674dde851e79fc6f4fe33a78fc43f1998367a77ed4e676a55a8467d2083b60438c65bb297ea
    – SHA256:a7db5f85a743c6c13f7dcab2e46dd943ecc929f04a46dd6bfd0280ca2052b0b6
    – SHA1:04994a3b73483c68935996ceed08cd51545a17d9 [weak]
    – MD5Sum:7201b56a16fcb84213d6a6bd1bf01f6c [weak]
    – Filesize:42566906 [weak]
    Hashes of received file:
    – SHA512:837dc730def6ae9a186102823b23ac9c4bb2f0c41c411908731bf69842b2a7576a4cc3f5111323f18aaf7432c61a4752d5cf2765fa520e8aa0a940d9672cfc14
    – SHA256:1c58dbcb86ce22459f852b9ce435cba16823af78f1b7639eeb39fe453b8601ad
    – SHA1:97f58da1561c0c33e42f44b3d231a16d57883db9 [weak]
    – MD5Sum:281a89d57aa896727de70496e5afa773 [weak]
    – Filesize:42566906 [weak]
    Last modification reported: Wed, 11 Mar 2020 19:47:08 +0000
    E: Failed to fetch https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64/docker-ce_19.03.8~3-0~debian-buster_amd64.deb Hash Sum mismatch
    Hashes of expected file:
    – SHA512:6157183c1f4472b24bb3fd8ddce4e659e4f69752496fd5287733d328865cf17abd812779e23ef000d3c705cbb6ddf3cfee5d23b175bd8b4be495bc6f75198f32
    – SHA256:aab5e08d0086ae6d0824e4286f2de160472c4206425105a68eb1bfdfc1f11ef3
    – SHA1:369de6e19806b1501df61fc8cdfda6e1ac89cce3 [weak]
    – MD5Sum:579f11f3582e2d527bf44fbf1775636a [weak]
    – Filesize:22863938 [weak]
    Hashes of received file:
    – SHA512:62aa75fa4f1223693771be1787bfcf685fe9ac10193a73f9af0faef2d5e60ba7315369b66570a6735aa3492ba078ffb8975a3c639e0d1f38f587790928a2d1ff
    – SHA256:e2801b52b1490b62937d6f01b6605f38b6edf8be3bea9e25c5ff2ea096370f2e
    – SHA1:4e2ef3334d51d0901c4d3c695771550e50628972 [weak]
    – MD5Sum:ef7582b03481c37997520afc901ef77b [weak]
    – Filesize:22863938 [weak]
    Last modification reported: Wed, 11 Mar 2020 19:47:08 +0000
    E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

    Reply
    • If you run apt policy docker-ce you will see that docker-ce is not in Debian Buster. Did you go through the Wiki instructions?

      Reply
  3. I get error saying: Package docker-ce is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    docker-ce-cli:amd64
    E: Package ‘docker-ce’ has no installation candidate
    How can I resolve the error?

    Reply
  4. So, this instruction works perfectly fine for systems on AMD64, but doesn’t work for i386. For i386 I ended up adding different repository to the Synaptic Package Manager and installing the Docker from there.

    Reply
  5. ok i keep getting this error when i run ‘ sudo apt install docker-ce ‘

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    docker-ce is already the newest version (5:20.10.1~3-0~debian-buster).
    The following package was automatically installed and is no longer required:
    wmdocker
    Use ‘sudo apt autoremove’ to remove it.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Setting up docker-ce (5:20.10.1~3-0~debian-buster) …
    Job for docker.service failed because the control process exited with error code.
    See “systemctl status docker.service” and “journalctl -xe” for details.
    invoke-rc.d: initscript docker, action “start” failed.
    ● docker.service – Docker Application Container Engine
    Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Thu 2020-12-17 01:53:33 +0330; 10ms ago
    Docs: https://docs.docker.com
    Process: 24494 ExecStart=/usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
    Main PID: 24494 (code=exited, status=1/FAILURE)
    dpkg: error processing package docker-ce (–configure):
    installed docker-ce package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    docker-ce
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    is there any idea?

    Reply
  6. I get a warning when I do

    “`
    > gpg –keyid-format 0xlong docker.gpg 2>/dev/null | grep -sq 0x8D81803C0EBFCD88 && sudo apt-key add docker.gpg
    “`

    Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
    OK

    Not sure the guide needs to be updated in that point.

    I could install docker by only changing `CODENAME=bullseye` (since I’m on MX Linux 21). Perhaps that part can be updated too.

    Reply

Leave a Comment

MX Linux