Skip to content

Commit

Permalink
Merge pull request #336 from thaJeztah/simplify_conditionals
Browse files Browse the repository at this point in the history
deb: simplify version-conditional installs
  • Loading branch information
thaJeztah committed Feb 3, 2023
2 parents 42b0cfa + f7f1ab8 commit 6647403
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,24 +437,20 @@ do_install() {
# older versions didn't ship the cli and containerd as separate packages
pkgs="$pkgs docker-ce-cli${cli_pkg_version%=} containerd.io"
fi
if version_gte "20.10"; then
pkgs="$pkgs docker-compose-plugin"
fi
if version_gte "20.10" && [ "$(uname -m)" = "x86_64" ]; then
# also install the latest version of the "docker scan" cli-plugin (only supported on x86 currently)
pkgs="$pkgs docker-scan-plugin"
fi
if version_gte "20.10"; then
pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version"
fi
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin"
fi
if ! is_dry_run; then
set -x
fi
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pkgs >/dev/null"
if version_gte "20.10"; then
# Install docker-ce-rootless-extras without "--no-install-recommends", so as to install slirp4netns when available
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras${pkg_version%=} >/dev/null"
fi
)
echo_docker_as_nonroot
exit 0
Expand Down

0 comments on commit 6647403

Please sign in to comment.