Skip to content

Commit a77c28b

Browse files
committed
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>
1 parent 73bf6ca commit a77c28b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

install.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ do_install() {
433433
(
434434
pkgs="docker-ce${pkg_version%=}"
435435
if version_gte "18.09"; then
436-
# older versions don't support a cli package
437-
pkgs="$pkgs docker-ce-cli${cli_pkg_version%=}"
436+
# older versions didn't ship the cli and containerd as separate packages
437+
pkgs="$pkgs docker-ce-cli${cli_pkg_version%=} containerd.io"
438438
fi
439439
if version_gte "20.10"; then
440440
pkgs="$pkgs docker-compose-plugin"
@@ -521,11 +521,11 @@ do_install() {
521521
(
522522
pkgs="docker-ce$pkg_version"
523523
if version_gte "18.09"; then
524-
# older versions don't support a cli package
524+
# older versions didn't ship the cli and containerd as separate packages
525525
if [ -n "$cli_pkg_version" ]; then
526-
pkgs="$pkgs docker-ce-cli-$cli_pkg_version"
526+
pkgs="$pkgs docker-ce-cli-$cli_pkg_version containerd.io"
527527
else
528-
pkgs="$pkgs docker-ce-cli"
528+
pkgs="$pkgs docker-ce-cli containerd.io"
529529
fi
530530
fi
531531
if version_gte "20.10" && [ "$(uname -m)" = "x86_64" ]; then
@@ -606,9 +606,10 @@ do_install() {
606606
pkgs="docker-ce$pkg_version"
607607
if version_gte "18.09"; then
608608
if [ -n "$cli_pkg_version" ]; then
609-
pkgs="$pkgs docker-ce-cli-$cli_pkg_version"
609+
# older versions didn't ship the cli and containerd as separate packages
610+
pkgs="$pkgs docker-ce-cli-$cli_pkg_version containerd.io"
610611
else
611-
pkgs="$pkgs docker-ce-cli"
612+
pkgs="$pkgs docker-ce-cli containerd.io"
612613
fi
613614
fi
614615
if version_gte "20.10"; then

0 commit comments

Comments
 (0)