Skip to content

Commit 88ef5bf

Browse files
fixing the errors in the checks
1 parent 3d5d00b commit 88ef5bf

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/docker-in-docker/install.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/bin/bash
2-
# shellcheck disable=all
1+
#!//usr/bin/env bash
32
#-------------------------------------------------------------------------------------------------------------
43
# Copyright (c) Microsoft Corporation. All rights reserved.
54
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
@@ -371,9 +370,7 @@ echo "Please log out and log back in to apply group changes."
371370

372371
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then
373372
echo "Docker / Moby CLI and Engine already installed."
374-
else
375-
if [ "${USE_MOBY}" = "true" ];then
376-
if { [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; }; then
373+
elif [ "${USE_MOBY}" = "true" ] && { [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; }; then
377374
# Install engine
378375
set +e # Handle error gracefully
379376
apt-get -y install --no-install-recommends \
@@ -391,10 +388,17 @@ else
391388
# Install compose
392389
apt-get -y install --no-install-recommends moby-compose || \
393390
err "Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping."
391+
else
392+
if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then
393+
apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix}
394+
# Install compose
395+
apt-mark hold docker-ce docker-ce-cli
396+
apt-get -y install --no-install-recommends docker-compose-plugin || echo "(*) Package docker-compose-plugin (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping."
397+
398+
399+
elif [ "${USE_MOBY}" = "true" ] && { [ "$ID" = "fedora" ] || [ "$ID_LIKE" = "rhel" ]; }; then
400+
install_docker_or_moby
394401

395-
elif [ "$ID" = "fedora" ] || [ "$ID_LIKE" = "rhel" ]; then
396-
install_docker_or_moby
397-
fi
398402
elif [ "${USE_MOBY}" = "false" ] && { [ "$ID" = "fedora" ] || [ "$ID_LIKE" = "rhel" ]; }; then
399403

400404
#kmod package is required for modprobe

0 commit comments

Comments
 (0)