Skip to content

[RFI] Adding the docker repo's GPG key to the system. #10347

@TriMoon

Description

@TriMoon

Problem description

  • apt-key(8)

    Note that if usage of apt-key is desired the additional installation of the GNU Privacy Guard suite packaged in gnupg) is required.
    For this reason alone the programmatic usage (especially in package maintainer scripts!) is strongly discouraged.
  • Current apt expects keys from packages to be put inside /etc/apt/trusted.gpg.d
    • binary keys ending in .gpg
    • ASCII-armored keys ending in .asc

Problem location

File: https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository

Suggestions for a fix

  1. The apt-key command should not be used in the instructions.
  2. The recommended command to retrieve the gpg-key should be changed into:
    (As a single command-line)
    sudo curl -LR https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/trusted.gpg.d/docker.gpg.asc
    • Notes:
      1. The -fsS flags to curl should not be used so the user has visual feedback and can retry in case of failures.
      2. The time-stamp of the source is used for the output file to aid in version checking.
      3. The output is put into a file under /etc/apt/trusted.gpg.d ending in .asc to indicate an ASCII-armored key to apt.
  3. The recommended command to check that the key is properly installed should be changed into:
    apt-key list docker
  4. The recommended command(s) to set up the "stable" repository should be changed into:
    > printf "%s %s %s %s %s\n" \
    	"deb" \
    	"[arch=amd64]" \
    	"https://download.docker.com/linux/ubuntu" \
    	"$(lsb_release -cs)" \
    	"stable" \
    	> /tmp/docker.list
    > sudo install \
    	--mode=a=r,u+w \
    	/tmp/docker.list \
    	/etc/apt/sources.list.d
    > rm /tmp/docker.list

Related reports

#1218, #8298, #9373, #10285, and maybe #10333?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions