Looks like their package repositories are having a bad day, or changes
were made (again);
# Executing docker install script, commit: 60327925bf2a9c6f81084661b0c05edc8263a3c9
+ sh -c 'yum install -y -q yum-utils'
Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This explict install was added because docker 20.10 did not have an explicit
dependency on the plugin. The current release of the Docker CLI (23.0) already
has a "Recommends:" dependency on the plugin, and 0095742fb5
removed the "--no-install-recommends", so fresh installs of Docker 23.0 will
already install this plugin through that dependency.
Removing the explicit install, because the scan-cli-plugin has been deprecated,
and will no longer receive updates, so we don't want it to be installed for the
upcoming 24.0 release when using this script. see;
https://github.com/docker/scan-cli-plugin/blob/b69ac460a6c23243b858326f0e26f6bd202ca781/internal/deprecation.go#L13-L15
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- updating the "version" to install to 20.10 (previous version)
- remove ubuntu 18.04, as it's EOL soon
- add last 2 LTS versions of Ubuntu
- add centos:9 (stream)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Now that 0095742fb5 removed the "--no-install-recommends"
option for all packages, we no longer need to special-case installation of the rootless-extras
package.
This patch moves the package together with other conditional packages for 20.10 and up. The
order of these conditionals was updated to match the equivalent steps of the RPM packages.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This variable was introduced in 63fb2060c9, but
was later refactored in ab03892649 aligned the
installation steps for SLES with the other distros (using the version of the
"docker-ce" package itself, as those versions always match).
This patch removes the unused rootless_pkg_version variable, and the code to
resolve that version.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The installation for deb packages used a --no-install-recommends to skip "recommended"
packages. This flag was added in ab5553e302 to work around
an issue on Ubuntu 17.10 (which had aufs-tools as recommended dependency), causing the
kernel to be updated.
While "recommended" packages _can_ be omitted during installation, they are
a "strong" recommendation, and should really be installed by default:
> Recommends
>
> This declares a strong, but not absolute, dependency.
> The Recommends field should list packages that would be found together
> with this one in all but unusual installations.
Including the `--no-install-recommends` option could result in `apparmor_parser`
binary (part of the `apparmor` package) to be missing, which would cause
the daemon failing to start on systems with AppArmor support enabled:
Error response from daemon: AppArmor enabled on system but the docker-default profile could not be loaded: running `apparmor_parser apparmor_parser --version` failed with output:
error: exec: "apparmor_parser": executable file not found in $PATH
Error: failed to start containers: somecontainer
This patch removes the `--no-install-recommends` so that the recommended
packages are installed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The version-format of the packages changed in the docker-ce-packaging repo;
https://github.com/docker/docker-ce-packaging/commit/39772a761dfdf810cc23a1ec6084ea3100e6abf0
Which caused the script to fail when specifying a version:
INFO: Searching repository for VERSION '23.0.0-rc.2'
INFO: apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2.*-0~debian' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
ERROR: '23.0.0-rc.2' not found amongst apt-cache madison results
Looking at that search, it seemed like it was overly strict;
- matching the distro (debian, ubuntu, or raspbian), which should not be needed,
assuming the package repository has been set up correctly (which the script
does in earlier steps).
- matching the "0" prefix, which was intended to be used a package-revision (so
to allow for packaging-only releases). That part definitely shouldn't be done,
as it would not match later revisions (1, 2, 3)
This patch simplifies the matching, and only searches for the package name, and
the version specified, which should satisfy the requirement;
apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
5:23.0.0~rc.2-1~ubuntu.22.04~jammy
apt-cache madison 'docker-ce-cli' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
5:23.0.0~rc.2-1~ubuntu.22.04~jammy
With this patch applied, the installation succeeds:
cat install.sh | DOWNLOAD_URL=https://download-stage.docker.com CHANNEL=test VERSION=23.0.0-rc.2 REPO_FILE=docker-ce-staging.repo sh
...
INFO: Searching repository for VERSION '23.0.0-rc.2'
INFO: apt-cache madison 'docker-ce' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
INFO: apt-cache madison 'docker-ce-cli' | grep '23.0.0.*rc.2' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce=5:23.0.0~rc.2-1~ubuntu.22.04~jammy docker-ce-cli=5:23.0.0~rc.2-1~ubuntu.22.04~jammy containerd.io docker-compose-plugin docker-scan-plugin docker-buildx-plugin >/dev/null
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These checks were originally added in 3217c543b4,
which added a `REPO_FILE` variable. While it's with good intent to do a check
if the URL is valid, there are some issues with these checks;
The checks depend on `curl`, but are executed _before_ `pre_reqs` are installed,
so will produce an error if `curl` is not found;
./install.sh
# Executing docker install script, commit:
./install.sh: line 469: curl: command not found
Error: Unable to curl repository file https://download.docker.com/linux/fedora/docker-ce.repo, is it valid?
The checks are currently always performed, also if `DRY_RUN=1` is enabled;
DRY_RUN=1 REPO_FILE=no-such.repo ./install.sh
# Executing docker install script, commit:
Error: Unable to curl repository file https://download.docker.com/linux/fedora/no-such.repo, is it valid?
This patch removes the checks to address the above, and to simplify the script.
Running the script will still fail if an invalid URL is used for the `.repo` file,
which fails the script after the `pre_reqs` are installed;
With this patch:
When running the script with `DRY_RUN=1`:
DRY_RUN=1 ./install.sh
# Executing docker install script, commit:
dnf install -y -q dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
dnf makecache
dnf install -y -q docker-ce docker-ce-cli containerd.io docker-scan-plugin docker-compose-plugin docker-ce-rootless-extras
When running the script with `DRY_RUN=1` and an invalid repo, the script
completes successfully, but will show the commands it will run, including
the invalid URL:
DRY_RUN=1 REPO_FILE=no-such.repo ./install.sh
# Executing docker install script, commit:
dnf install -y -q dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/fedora/no-such.repo
dnf makecache
dnf install -y -q docker-ce docker-ce-cli containerd.io docker-scan-plugin docker-compose-plugin docker-ce-rootless-extras
When running the script with an invalid repo URL, it will fail early (after
installing `pre_reqs`:
REPO_FILE=no-such.repo ./install.sh
# Executing docker install script, commit:
+ sh -c 'dnf install -y -q dnf-plugins-core'
...
+ sh -c 'dnf config-manager --add-repo https://download.docker.com/linux/fedora/no-such.repo'
Adding repo from: https://download.docker.com/linux/fedora/no-such.repo
Status code: 404 for https://download.docker.com/linux/fedora/no-such.repo (IP: 65.9.86.56)
Error: Configuration of repo failed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This check gives a lot of false positives; ignoring it;
```
In build/install.sh line 106:
set +x
^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 108:
yy_a="$(echo "$1" | cut -d'.' -f1)"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^-----------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 109:
yy_b="$(echo "$2" | cut -d'.' -f1)"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^-----------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 110:
if [ "$yy_a" -lt "$yy_b" ]; then
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^---------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 111:
return 1
^------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 113:
if [ "$yy_a" -gt "$yy_b" ]; then
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^---------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 114:
return 0
^------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 116:
mm_a="$(echo "$1" | cut -d'.' -f2)"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^-----------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 117:
mm_b="$(echo "$2" | cut -d'.' -f2)"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^-----------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 118:
if [ "${mm_a#0}" -lt "${mm_b#0}" ]; then
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
^-----------------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 119:
return 1
^------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 122:
return 0
^------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In build/install.sh line 659:
exit 1
^----^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
For more information:
https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable...
make: *** [Makefile:20: shellcheck] Error 1
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>