Commit Graph
417 Commits
Author SHA1 Message Date
Sebastiaan van Stijn c044d7d311 Merge pull request #334 from crazy-max/fix-buildx
fix buildx install
2023-02-02 21:12:15 +01:00
CrazyMax 1cb5c544e2 fix buildx install
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-02-02 21:04:55 +01:00
Sebastiaan van Stijn 1d97565eca Merge pull request #330 from thaJeztah/fix_version_matching
fix matching of package versions on debian, ubuntu, and raspbian
2023-01-12 00:21:20 +01:00
Sebastiaan van Stijn 62046868dc Merge pull request #331 from thaJeztah/bump_rootless_install
rootless: update versions to 20.10.22 (stable) and 23.0.0-rc.1 (testing)
2023-01-12 00:20:28 +01:00
Sebastiaan van Stijn 5429d31315 rootless: update test version to 23.0.0-rc.1
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-11 23:46:52 +01:00
Sebastiaan van Stijn 996a1f9a9f rootless: update stable version to 20.10.22
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-01-11 23:46:21 +01:00
Sebastiaan van Stijn d32be0ab1d fix matching of package versions on debian, ubuntu, and raspbian
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>
2023-01-11 23:41:58 +01:00
Sebastiaan van Stijn 00ffef53ad Merge pull request #319 from thaJeztah/rootless_20.10.21
update rootless-install to 20.10.21
2022-10-25 17:52:50 -04:00
Sebastiaan van Stijn 54e3d6325a update rootless-install to 20.10.21
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-25 17:30:20 -04:00
Sebastiaan van Stijn af4386b65c Merge pull request #317 from thaJeztah/rootless_20.10.20
update rootless-install to 20.10.20
2022-10-19 10:32:09 +02:00
Sebastiaan van Stijn c8a23ecfa9 update rootless-install to 20.10.20
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-19 10:05:49 +02:00
Sebastiaan van Stijn 487d349baf Merge pull request #316 from thaJeztah/rootless_20.10.19
update rootless-install to 20.10.19
2022-10-18 14:38:08 +02:00
Sebastiaan van Stijn 4112fb6983 update rootless-install to 20.10.19
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-18 14:35:27 +02:00
Sebastiaan van Stijn 5ac4196e77 Merge pull request #312 from AkihiroSuda/rootless-20.10.18
update rootless-install to 20.10.18
2022-09-21 13:44:08 +02:00
Akihiro Suda 835c5bec9a update rootless-install to 20.10.18
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-09-10 22:46:58 +09:00
Sebastiaan van Stijn 4f282167c4 Merge pull request #310 from thaJeztah/remove_checks
fix "REPO_FILE" checks always running, also with "dry run" enabled
2022-08-29 16:23:27 +02:00
Sebastiaan van Stijn 0c9037543e fix "REPO_FILE" checks always running, also with "dry run" enabled
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>
2022-08-29 14:52:08 +02:00
Sebastiaan van Stijn 170a1cd88f Merge pull request #306 from linux-on-ibm-z/sles-fix
Adds SLES 15-SP4 support
2022-08-29 13:44:18 +02:00
Prabhav Thali 4d8fdb9633 Adds SLES 15-SP4 support
Signed-off-by: Prabhav Thali <Prabhav.Thali1@ibm.com>
2022-08-29 16:55:22 +05:30
Sebastiaan van Stijn ea9a00694b Merge pull request #309 from thaJeztah/shellcheck_ignore
shellcheck: ignore SC2317
2022-08-26 00:46:00 +02:00
Sebastiaan van Stijn 0f72df0a14 shellcheck: ignore SC2317
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>
2022-08-25 22:13:47 +02:00
Sebastiaan van Stijn b2e29ef7a9 Merge pull request #295 from thaJeztah/add_buildx_package
install docker-buildx-plugin on >= 22.06 (test channel only currently)
2022-06-07 11:51:18 +02:00
Sebastiaan van Stijn df6b6926dc install docker-buildx-plugin on >= 22.06 (test channel only currently)
The buildx plugin has moved to a separate package for the 22.06 release.
We're currently doing test-builds on staging, so only try to install
this when using both the "test" channel and the staging domain.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-07 03:39:16 +02:00
Sebastiaan van Stijn ed679a8000 Merge pull request #297 from thaJeztah/update_rootless2
update rootless-install to 20.10.17
2022-06-07 03:38:02 +02:00
Sebastiaan van Stijn 307042a58d update rootless-install to 20.10.17
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-07 03:33:16 +02:00
Sebastiaan van Stijn 3255aa3919 Merge pull request #294 from thaJeztah/update_gpg
Update to use /etc/apt/keyrings per APT maintainers recommendations
2022-05-25 12:50:07 +02:00
Sebastiaan van Stijn f2979412df Update to use /etc/apt/keyrings per APT maintainers recommendations
See https://tracker.debian.org/news/1305679/accepted-apt-240-source-into-unstable/:

    * Install an empty /etc/apt/keyrings directory.
      This directory is intended to provide an alternative to
      /usr/share/keyrings for placing keys used with signed-by.

See also https://wiki.debian.org/DebianRepository/UseThirdParty?action=diff&rev2=47&rev1=46
(which was edited following a discussion with the APT maintainers about the expected usage):

> If future updates to the key will be managed by an apt/dpkg package as
> recommended below, then it SHOULD be downloaded into `/usr/share/keyrings`
> using the same filename that will be provided by the package. If it will
> be managed locally , it SHOULD be downloaded into `/etc/apt/keyrings` instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-24 15:59:20 +02:00
Sebastiaan van Stijn ee3e0e0626 Merge pull request #290 from thaJeztah/update_rootless
rootless-install.sh: update to 20.10.16
2022-05-12 18:18:48 +02:00
Sebastiaan van Stijn 12ac8eab87 rootless-install.sh: update to 20.10.16
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-12 17:35:53 +02:00
Sebastiaan van Stijn aca173ad8e rootless-install.sh: update to 20.10.15
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-12 17:35:50 +02:00
Sebastiaan van Stijn 614d05e0e6 Merge pull request #291 from thaJeztah/install_update_containerd
Explicitly install containerd.io to handle upgrades
2022-05-12 15:45:58 +02:00
Sebastiaan van Stijn a77c28b7fc Explicitly install containerd.io to handle upgrades
While the script isn't intended for updating existing installations,
some users use it for that purpose, and when doing so may end up in
a situation where only the docker packages are updated, but containerd
is kept at the already installed version.

This patch explicitly installs the containerd.io package so that running
the script on an existing installation also updates the containerd.io
package to the latest version.

Docker packages before 18.09 bundled containerd in the docker-ce package,
so this step is made options based on the version that's requested to be
installed (defaults to "latest").

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-10 12:50:11 +02:00
Sebastiaan van Stijn 73bf6ca324 Merge pull request #289 from linux-on-ibm-z/sles-fix
Fix zypper command syntax
2022-05-06 19:56:46 +02:00
Prabhav Thali f3ba5b5669 fix zypper command syntax
Signed-off-by: Prabhav Thali <Prabhav.Thali1@ibm.com>
2022-05-04 17:45:55 +05:30
Sebastiaan van Stijn 0221adedb4 Merge pull request #288 from thaJeztah/carry_add_compose_v2
Add docker-compose-plugin package
2022-04-26 12:31:45 +02:00
Debdut Chakraborty 90d0bdf7b6 Add docker-compose-plugin package
Signed-off-by: Debdut Chakraborty <debdut.chakraborty@rocket.chat>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-25 20:10:40 +02:00
Sebastiaan van Stijn dad6f89598 Merge pull request #287 from thaJeztah/normalize_steps
align approach for packages to install between rpm and deb steps
2022-04-25 20:08:17 +02:00
Sebastiaan van Stijn ab03892649 align approach for packages to install between rpm and deb steps
This aligns the approach taken between rpm- and deb-based installations to first
collect the list of packages to install in a `$pkgs` variable, and then install
them all, instead of executing an install for each of them.

With this change:

Fedora

    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 docker-scan-plugin docker-ce-rootless-extras

CentOS

    DRY_RUN=1 ./install.sh
    # Executing docker install script, commit:
    yum install -y -q yum-utils
    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    yum makecache
    yum install -y -q docker-ce docker-ce-cli docker-scan-plugin docker-ce-rootless-extras

Ubuntu

    DRY_RUN=1 ./install.sh
    # Executing docker install script, commit:
    apt-get update -qq >/dev/null
    DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl gnupg >/dev/null
    curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg
    chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" > /etc/apt/sources.list.d/docker.list
    apt-get update -qq >/dev/null
    DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends  docker-ce-cli docker-scan-plugin docker-ce >/dev/null
    DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras >/dev/null

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-25 18:25:58 +02:00
Sebastiaan van Stijn 0225270d2d Merge pull request #277 from thaJeztah/rootless_linting
rootless-install.sh: fix some shellcheck warnings
2022-03-25 00:31:09 +01:00
Sebastiaan van Stijn 47b693cf80 rootless-install.sh: fix some shellcheck warnings
Fixes some shellcheck linting warnings:

- [SC2034][SC2034]: "SCRIPT_COMMIT_SHA appears unused. Verify use (or export if used externally)."
- [SC2046][SC2046]: "Quote this to prevent word splitting"
- [SC2002][SC2002]: "Useless cat. Consider cmd < file | .. or cmd file | .. instead"
- [SC2064][SC2064]: "Use single quotes, otherwise this expands now rather than when signalled."

[SC2034]: https://github.com/koalaman/shellcheck/wiki/SC2034
[SC2002]: https://github.com/koalaman/shellcheck/wiki/SC2002
[SC2046]: https://github.com/koalaman/shellcheck/wiki/SC2046
[SC2064]: https://github.com/koalaman/shellcheck/wiki/SC2064

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-24 05:00:03 +01:00
Sebastiaan van Stijn 9809a3daab Merge pull request #279 from thaJeztah/bump_rootless_20.10.14
rootless-install.sh: update to 20.10.14
2022-03-24 04:35:33 +01:00
Sebastiaan van Stijn 7957df7e58 rootless-install.sh: update to 20.10.14
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-24 04:14:56 +01:00
Sebastiaan van Stijn 07b4d2541e Merge pull request #275 from thaJeztah/update_rootless
rootless-install.sh: update to 20.10.13
2022-03-21 16:10:13 +01:00
Sebastiaan van Stijn 47f7993357 Merge pull request #276 from thaJeztah/fix_keyring_permissions
install.sh: set read-permissions for environments with non-standard umask
2022-03-21 16:09:51 +01:00
e5f4d99c75 install.sh: set read-permissions for environments with non-standard umask
Some environments may have a non-standard (non 022) umask set, in which case
the keyring would not get read-permissions for all users, which lead to errors
during install:

    W: GPG error: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

This commit changes the permissions of the file, so that it's world-readable.
See https://stackoverflow.com/a/68764068

Co-Authored-By: ManhIT <manhit@s-developers.com>
Co-Authored-By: Hervé M <hmag@users.noreply.github.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-21 15:56:26 +01:00
Sebastiaan van Stijn 115a7774b5 rootless-install.sh: update to 20.10.13
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-21 15:26:32 +01:00
Sebastiaan van Stijn c6e44282af Merge pull request #268 from AkihiroSuda/rootless-20.10.12
rootless-install.sh: update to 20.10.12
2021-12-22 16:00:24 +01:00
Akihiro Suda f72a74dc3c rootless-install.sh: update to 20.10.12
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-15 18:48:37 +09:00
Sebastiaan van Stijn fa5e8eaa2b Merge pull request #252 from danifr/patch-1
Fix typo in README
2021-12-09 10:41:37 +01:00
Sebastiaan van Stijn 8095e19330 Merge pull request #263 from thaJeztah/update_rootless
rootless-install.sh: update to docker 20.10.11
2021-11-18 10:12:03 +01:00