Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix importing GPG key approach for Debian-based #19611

Closed
wants to merge 1 commit into from

Conversation

peter279k
Copy link

Description

  • According to the original importing GPG key approach, it will be failed in older Debian-based versions.
    And it should be backward compatibility for all versions.
  • It seems that Debian-based and Raspberry Pi OS versions will be successful with original approach and this approach.
    To be consistency, it should use the same approach for all Debian-based versions.
  • By default, these apt-transport-https and gnupg are not installed and it should be installed to complete the Docker package installations.

Here are scripts to test the original approach in fresh Ubuntu containers:

#!/bin/bash

for ver in 16 18 20 22;
do
    echo "Ubuntu $ver";
    docker run -it --network=host --rm ubuntu:$ver.04 bash -c 'apt update &>/dev/null && apt-get install -y apt-transport-https ca-certificates gnupg curl &>/dev/null && install -m 0755 -d /etc/apt/keyrings && curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && chmod a+r /etc/apt/keyrings/docker.asc && echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee \
    /etc/apt/sources.list.d/docker.list &>/dev/null && apt-get update'
    break
done;

And running outputs are as follows:

Ubuntu 16
Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
58690f9b18fc: Pull complete
b51569e7c507: Pull complete
da8ef40b9eca: Pull complete
fb15d46c38dc: Pull complete
Digest: sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d6
Status: Downloaded newer image for ubuntu:16.04
Get:1 https://download.docker.com/linux/ubuntu xenial InRelease [66.2 kB]
Ign:1 https://download.docker.com/linux/ubuntu xenial InRelease
Get:2 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [23.9 kB]
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 90.1 kB in 1s (82.3 kB/s)
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: The repository 'https://download.docker.com/linux/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Ubuntu 18
Unable to find image 'ubuntu:18.04' locally
18.04: Pulling from library/ubuntu
7c457f213c76: Pull complete
Digest: sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98
Status: Downloaded newer image for ubuntu:18.04
Get:1 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Get:2 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [46.4 kB]
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Fetched 111 kB in 1s (82.3 kB/s)
Reading package lists... Done
Ubuntu 20
Unable to find image 'ubuntu:20.04' locally
20.04: Pulling from library/ubuntu
17d0386c2fff: Pull complete
Digest: sha256:80ef4a44043dec4490506e6cc4289eeda2d106a70148b74b5ae91ee670e9c35d
Status: Downloaded newer image for ubuntu:20.04
Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [46.1 kB]
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 104 kB in 1s (94.3 kB/s)
Reading package lists... Done
Ubuntu 22
Unable to find image 'ubuntu:22.04' locally
22.04: Pulling from library/ubuntu
bccd10f490ab: Pull complete
Digest: sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e
Status: Downloaded newer image for ubuntu:22.04
Get:1 https://download.docker.com/linux/ubuntu jammy InRelease [48.8 kB]
Get:2 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages [32.6 kB]
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 81.4 kB in 1s (63.6 kB/s)
Reading package lists... Done

Here is the test script to use this approach:

#!/bin/bash

for ver in 16 18 20 22;
do
    echo "Ubuntu $ver";
    docker run -it --network=host --rm ubuntu:$ver.04 bash -c 'apt update &>/dev/null && apt-get install -y apt-transport-https ca-certificates gnupg curl &>/dev/null && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee \
    /etc/apt/sources.list.d/docker.list &>/dev/null && apt-get update'
done;

And running outputs are as follows:

Ubuntu 16
Get:1 https://download.docker.com/linux/ubuntu xenial InRelease [66.2 kB]
Get:2 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [23.9 kB]
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 90.1 kB in 1s (54.8 kB/s)
Reading package lists... Done
Ubuntu 18
Get:1 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Get:2 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [46.4 kB]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Fetched 111 kB in 2s (57.1 kB/s)
Reading package lists... Done
Ubuntu 20
Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [46.1 kB]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Fetched 104 kB in 2s (48.6 kB/s)
Reading package lists... Done
Ubuntu 22
Get:1 https://download.docker.com/linux/ubuntu jammy InRelease [48.8 kB]
Get:2 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages [32.6 kB]
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 81.4 kB in 1s (63.6 kB/s)
Reading package lists... Done

Related issues or tickets

  • N/A

Reviews

  • Technical review
  • Editorial review
  • Product review

@peter279k peter279k requested a review from dvdksn as a code owner March 13, 2024 08:20
@github-actions github-actions bot added the area/install Relates to installing a product label Mar 13, 2024
Copy link

netlify bot commented Mar 13, 2024

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit bac7345
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/65f161c15d0add0008556e15
😎 Deploy Preview https://deploy-preview-19611--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dvdksn
Copy link
Collaborator

dvdksn commented Mar 13, 2024

The oldest supported versions of ubuntu/debian are currently:

  • 20.04
  • bullseye

The installation instruction doesn't support versions older than that

@peter279k
Copy link
Author

I see. These related descriptions are available in the OS Requirements section.

But the Docker image mirror site is still available for older verisons.

@dvdksn
Copy link
Collaborator

dvdksn commented Mar 13, 2024

Yes, the packages are still available, but we don't maintain the installation instructions or test the installation for these versions

@peter279k
Copy link
Author

If someone needs to use/test in these older versions, what should they do?

Is there any reference in this documentation?

@dvdksn
Copy link
Collaborator

dvdksn commented Mar 13, 2024

@peter279k for instructions on how to add ppa on older OS versions, please consult the relevant man pages and other documentation for the distribution you're using. If you want to reference an outdated version of Docker docs, you can always try http://wayback.archive.org/ or building the docs from source in a historic commit

@dvdksn dvdksn closed this Mar 13, 2024
@peter279k peter279k deleted the import_gpg_key_fix branch March 13, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Relates to installing a product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants