Skip to content

Conversation

@bligneri
Copy link

The instructions do not work.
I believe the file need to be in gpg format.

Tested on a fresh debian 12 install withn only htop and nvim installed.

Description

Related issues or tickets

Reviews

  • Technical review
  • Editorial review
  • Product review

The instructions do not work.
I believe the file need to be in gpg format.

Tested on a fresh debian 12 install withn only htop and nvim installed.
@bligneri bligneri requested a review from dvdksn as a code owner September 27, 2024 02:02
@github-actions github-actions bot added area/engine Issue affects Docker engine/daemon area/install Relates to installing a product labels Sep 27, 2024
@netlify
Copy link

netlify bot commented Sep 27, 2024

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit e761e1d
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/66f7428c1d73e8000872dc00
😎 Deploy Preview https://deploy-preview-21012--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.

Copy link

@offensive-vk offensive-vk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested it? I mean locally?

Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is desirable. Can you explain the error you encountered?

@bligneri
Copy link
Author

I did change the URL for a debian URL.
I don't know why we need to dearmor but I can confirm that without this change, the instructions are not working.

With the change, one can install the docker source and then install locker on a fresh new debian install.

@dvdksn
Copy link
Contributor

dvdksn commented Sep 27, 2024

pinging @thaJeztah @tianon for input here... Do either of you know why this is happening? We also have #20834 which looks like an attempt at a workaround.

@thaJeztah
Copy link
Member

No idea what's happening there; I tried on a fresh install of Debian 12 on DigitalOcean, and using the steps from the docs, all works without issues;

apt-get update
apt-get install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

It's worth checking what your /etc/apt/sources.list.d/docker.list looks like, and if perhaps something went wrong there, and it's looking for the wrong distro and/or key.

We have over a million weekly downloads of packages for Debian, so at least it's not a widespread issue, but it could be something specific in your environment (I have run into some cloud providers having some non-standard / minimalized setup)

@bligneri
Copy link
Author

I still have the issue on my home server. If I follow the instructions, it does not work:

1 Removed the files in /etc/atp/keyring => apt should not work

root@ligneris-cloud:/etc/apt/keyrings# apt update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]    
Get:3 http://security.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Hit:4 https://download.docker.com/linux/debian bookworm InRelease                                                  
Get:5 http://security.debian.org/debian-security bookworm-security/main Sources [111 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main amd64 Packages [183 kB]
Get:7 http://security.debian.org/debian-security bookworm-security/main Translation-en [111 kB]
Err:4 https://download.docker.com/linux/debian bookworm InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
Fetched 508 kB in 1s (787 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://download.docker.com/linux/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: Failed to fetch https://download.docker.com/linux/debian/dists/bookworm/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: Some index files failed to download. They have been ignored, or old ones used instead.

Step 2: follow the documentation to download the key and add it to the keyring

root@ligneris-cloud:/etc/apt/keyrings# curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
root@ligneris-cloud:/etc/apt/keyrings# chmod a+r /etc/apt/keyrings/docker.asc
root@ligneris-cloud:/etc/apt/keyrings# apt update                                                                             
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease                  
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease   
Hit:4 https://download.docker.com/linux/debian bookworm InRelease
Err:4 https://download.docker.com/linux/debian bookworm InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://download.docker.com/linux/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: Failed to fetch https://download.docker.com/linux/debian/dists/bookworm/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: Some index files failed to download. They have been ignored, or old ones used instead.

The file is there:

root@ligneris-cloud:/etc/apt/keyrings# ls -la
total 12
drwxr-xr-x 2 root root 4096 Sep 27 16:30 .
drwxr-xr-x 9 root root 4096 Sep 27 16:29 ..
-rw-r--r-- 1 root root 3817 Sep 27 16:30 docker.asc
root@ligneris-cloud:/etc/apt/keyrings# cat docker.asc 
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFit2ioBEADhWpZ8/wvZ6hUTiXOwQHXMAlaFHcPH9hAtr4F1y2+OYdbtMuth
lqqwp028AqyY+PRfVMtSYMbjuQuu5byyKR01BbqYhuS3jtqQmljZ/bJvXqnmiVXh
38UuLa+z077PxyxQhu5BbqntTPQMfiyqEiU+BKbq2WmANUKQf+1AmZY/IruOXbnq
L4C1+gJ8vfmXQt99npCaxEjaNRVYfOS8QcixNzHUYnb6emjlANyEVlZzeqo7XKl7
UrwV5inawTSzWNvtjEjj4nJL8NsLwscpLPQUhTQ+7BbQXAwAme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nkKU+HKjvMROl1DK7zdmLdNzA1cvtZH/nCC9KPj1z8QC47S
xx+dTZSx4ONAhwbS/LN3PoKtn8LPjY9NP9uDWI+TWYquS2U+KHDrBDlsgozDbs/O
jCxcpDzNmXpWQHEtHU7649OXHP7UeNST1mCUCH5qdank0V1iejF6/CfTFU4MfcrG
YT90qFF93M3v01BbxP+EIY2/9tiIPbrd
=0YYh
-----END PGP PUBLIC KEY BLOCK-----

@bligneri
Copy link
Author

If I use the proposed changes, it works:


```apt update               
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 https://download.docker.com/linux/debian bookworm InRelease                  
Hit:3 http://deb.debian.org/debian bookworm InRelease                              
Hit:4 http://deb.debian.org/debian bookworm-updates InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

I can now install and maintain the docker packages

@bligneri
Copy link
Author

This is a bare metal install and not an install pre-made by a cloud provider. It may explain why we have a different behaviour?

uname -a
Linux ligneris-cloud 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux

etc/debian_version 
12.7

@thaJeztah
Copy link
Member

The PR with the current changes would fail, because it configures the repository with signed-by=/etc/apt/keyrings/docker.asc, but the key is stored with .gpg as extension.

What does the content of your /etc/apt/sources.list.d/docker.list look like?

@bligneri
Copy link
Author

Good call.

This is my source file.

cat /etc/apt/sources.list.d/docker.list 
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian   bookworm stable

Let me double check with the .asc file in the source.list.d file

It was not working when I installed initially following the instructions but I did debug on the machine itself.

@bligneri
Copy link
Author

OK. This is really weird.
I changed it to docker.asc and now it works with only the /etc/apt/keyring/docker.asc file.

But I can confirm 💯 % that it was not working during the initial install ;-(

@bligneri
Copy link
Author

From this: https://stackoverflow.com/questions/60137344/docker-how-to-solve-the-public-key-error-in-ubuntu-while-installing-docker

It looks like the default dir is nowe /usr/share/keyrings

Also in this directory on my debian 12, you can see that all the files are in gpg format.

ls /usr/share/keyrings/

debian-archive-bookworm-automatic.gpg		debian-archive-bullseye-security-automatic.gpg	debian-archive-buster-stable.gpg
debian-archive-bookworm-security-automatic.gpg	debian-archive-bullseye-stable.gpg		debian-archive-keyring.gpg
debian-archive-bookworm-stable.gpg		debian-archive-buster-automatic.gpg		debian-archive-removed-keys.gpg
debian-archive-bullseye-automatic.gpg		debian-archive-buster-security-automatic.gpg

@bligneri
Copy link
Author

My proposal would be then to:

  1. use the new location /usr/share/keyrings
  2. use the .gpg extension as it seems to be the new default for debian (and ubuntu) ?

@bligneri
Copy link
Author

Why it may happen?
It maybe a permission problem / umask problem (as explained in the stackoverflow above).

It did now work while I was in the original session on my new install immediately after the first reboot from the read-only install (USB stick).

=> Then after this, I did open new sessions (by SSH) and it is now a different session with updated env variable and all.

@bligneri
Copy link
Author

I did update the file accordingly but I did not test by cut&pasting. I believe I need the deploy preview.

Also I think we could use apt instead of apt-get as it seems to be more and more the default.

I don't know enough about the doc build system to know if it will break thinks for older versions of debian.

@thaJeztah
Copy link
Member

This is my source file.

cat /etc/apt/sources.list.d/docker.list 
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian   bookworm stable

Thanks! Yes, that is referring to /etc/apt/keyrings/docker.gpg, which means that when trying to install a package from download.docker.com/linux/debian, it will look for /etc/apt/keyrings/docker.gpg. If that file is missing (which would be the case if it's stored as docker.asc), it won't find the file, and print an error.

From this: https://stackoverflow.com/questions/60137344/docker-how-to-solve-the-public-key-error-in-ubuntu-while-installing-docker

It looks like the default dir is nowe /usr/share/keyrings

That looks to be outdated information; (IIUC) the /usr/share/keyrings is intended for the distro's default keys, whereas /etc/apt/keyrings/ is to be used for keys that are referenced through the signed-by= directive; see

The intent here is for "EPEL" repositories (like download.docker.com) to explicitly define the key to use, and those keys not to be put in the global store (which can be discovered automatically).

Also in this directory on my debian 12, you can see that all the files are in gpg format.

Either .gpg or .asc should be OK, but the file-extension should match the content; older versions of apt / apt-get required the GPG key to manually be converted from ASCII (.asc) to Binary (.gpg) through --dearmor. Current versions should be able to handle both, as long as the file-extension is correct; see

It did now work while I was in the original session on my new install immediately after the first reboot from the read-only install (USB stick).

Not sure what happened there; wondering if you perhaps combined some "new" with "old" instructions, and used --dearmor for the file, but then stored it as .asc (in which case the file would've been stored in the correct location, but with the wrong format for the extension)?

Also I think we could use apt instead of apt-get as it seems to be more and more the default.

We use apt-get because, unlike apt, it has a stable ABI and for that reason is still the preferred one to use when scripting. While these instructions may be run manually by the user, they're also often used by users as a starting point for scripting these steps; if they do, it's good to already have the instructions using the variant that's most suitable for that. It's also the reasy why you'll find most (if not all) our examples that install packages as part of a Dockerfile to use apt-get.

Of course, you're welcome to adjust examples according to your preference / situation for your use.

@bligneri
Copy link
Author

OK. I did another fresh bare metal install on the exact same hardware with the same Debian installer via USB ... and the instructions worked as expected.

I still don't know what went wrong, sorry for the noise.

I think we can close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine Issue affects Docker engine/daemon area/install Relates to installing a product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants