This step in the installation script was added to take non-standard umasks
into account (which is sometimes the case on some cloud providers).
The existing command was changing modes a bit too eagerly, as it recursively
set the "execute" bit, which would not only affect the /etc/apt/keyrings
directory, but also any file inside it (including files we don't own);
mkdir -m 0700 keyrings
touch keyrings/one.sh
touch keyrings/docker.gpg
ls -al keyrings/
total 8
drwx------ 4 root root 128 May 7 11:43 .
drwx------ 17 root root 544 May 7 11:43 ..
-rw-r--r-- 1 root root 0 May 7 11:43 docker.gpg
-rw-r--r-- 1 root root 0 May 7 11:43 one.sh
chmod -R a+rx keyrings
ls -al keyrings/
total 0
drwxr-xr-x 4 root root 128 May 7 11:43 .
drwx------ 17 root root 544 May 7 11:43 ..
-rwxr-xr-x 1 root root 0 May 7 11:43 docker.gpg
-rwxr-xr-x 1 root root 0 May 7 11:43 one.sh
This patch changes the script to use `install`, which creates the directory
if it doesn't exist, and sets the permissions on the directory itself, without
recursing to files inside it:
mkdir -m 0700 keyrings2
touch keyrings2/one.sh
touch keyrings2/docker.gpg
ls -al keyrings2/
total 8
drwx------ 2 root root 4096 May 7 11:44 .
drwxr-xr-x 1 root root 4096 May 7 11:44 ..
-rw-r--r-- 1 root root 0 May 7 11:44 docker.gpg
-rw-r--r-- 1 root root 0 May 7 11:44 one.sh
install -m 0755 -d keyrings2/
total 8
drwxr-xr-x 2 root root 4096 May 7 11:44 .
drwxr-xr-x 1 root root 4096 May 7 11:44 ..
-rw-r--r-- 1 root root 0 May 7 11:44 docker.gpg
-rw-r--r-- 1 root root 0 May 7 11:44 one.sh
Changing permissions of the `docker.gpg` file itself is already handled
separately through `chmod a+r /etc/apt/keyrings/docker.gpg`.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker/docker-install
Home of the script that lives at get.docker.com and test.docker.com!
The purpose of the install script is for a convenience for quickly installing the latest Docker-CE releases on the supported linux distros. It is not recommended to depend on this script for deployment to production systems. For more thorough instructions for installing on the supported distros, see the install instructions.
This repository is solely maintained by Docker, Inc.
Usage:
From https://get.docker.com:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
From https://test.docker.com:
curl -fsSL https://test.docker.com -o test-docker.sh
sh test-docker.sh
From the source repo (This will install latest from the stable channel):
sh install.sh
Testing:
To verify that the install script works amongst the supported operating systems run:
make shellcheck
Legal
Brought to you courtesy of our legal counsel. For more context, please see the NOTICE document in this repo.
Use and transfer of Docker may be subject to certain restrictions by the United States and other governments.
It is your responsibility to ensure that your use and/or transfer does not violate applicable laws.
For more information, please see https://www.bis.doc.gov
Reporting security issues
The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away!
Please DO NOT file a public issue, instead send your report privately to security@docker.com.
Security reports are greatly appreciated and we will publicly thank you for it. We also like to send gifts—if you're into Docker schwag, make sure to let us know. We currently do not offer a paid security bounty program, but are not ruling it out in the future.
Licensing
docker/docker-install is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.