Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 253314b

Browse files
authored
Regression fixes for stretch, fallback logic
1 parent 89a70b9 commit 253314b

26 files changed

+83
-50
lines changed

script-library/azcli-debian.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
5858
architecture="$(dpkg --print-architecture)"
5959
if [ "${architecture}" = "amd64" ]; then
6060
# Install dependencies
61-
check_packages apt-transport-https curl ca-certificates gnupg2
61+
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
6363
. /etc/os-release
6464
get_common_setting MICROSOFT_GPG_KEYS_URI

script-library/common-alpine.sh

100644100755
File mode changed.

script-library/common-debian.sh

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
7878
package_list="apt-utils \
7979
openssh-client \
8080
gnupg2 \
81+
dirmngr \
8182
iproute2 \
8283
procps \
8384
lsof \

script-library/common-redhat.sh

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
6363
package_list="\
6464
openssh-clients \
6565
gnupg2 \
66+
dirmngr \
6667
iproute \
6768
procps \
6869
lsof \

script-library/desktop-lite-debian.sh

100644100755
File mode changed.

script-library/docker-debian.sh

100644100755
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ check_packages() {
7878
export DEBIAN_FRONTEND=noninteractive
7979

8080
# Install dependencies
81-
check_packages apt-transport-https curl ca-certificates gnupg2
81+
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
8282

8383
# Install Docker / Moby CLI if not already installed
84+
architecture="$(dpkg --print-architecture)"
8485
if type docker > /dev/null 2>&1; then
8586
echo "Docker / Moby CLI already installed."
8687
else
@@ -90,9 +91,10 @@ else
9091
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
9192
get_common_setting MICROSOFT_GPG_KEYS_URI
9293
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
93-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
94+
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
9495
apt-get update
95-
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
96+
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
97+
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
9698
else
9799
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
98100
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg

script-library/docker-in-docker-debian.sh

100644100755
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ check_packages() {
7676
export DEBIAN_FRONTEND=noninteractive
7777

7878
# Install dependencies
79-
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2
79+
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2 dirmngr
8080

8181
# Swap to legacy iptables for compatibility
8282
if type iptables-legacy > /dev/null 2>&1; then
@@ -85,6 +85,7 @@ if type iptables-legacy > /dev/null 2>&1; then
8585
fi
8686

8787
# Install Docker / Moby CLI if not already installed
88+
architecture="$(dpkg --print-architecture)"
8889
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then
8990
echo "Docker / Moby CLI and Engine already installed."
9091
else
@@ -94,9 +95,10 @@ else
9495
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
9596
get_common_setting MICROSOFT_GPG_KEYS_URI
9697
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
97-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
98+
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
9899
apt-get update
99-
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose moby-engine
100+
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
101+
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
100102
else
101103
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
102104
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
@@ -112,11 +114,11 @@ echo "Finished installing docker / moby"
112114
if type docker-compose > /dev/null 2>&1; then
113115
echo "Docker Compose already installed."
114116
else
115-
TARGET_COMPOSE_ARCH="$(uname -m)"
116-
if [ "${TARGET_COMPOSE_ARCH}" = "amd64" ]; then
117-
TARGET_COMPOSE_ARCH="x86_64"
117+
target_compose_arch="${architecture}"
118+
if [ "${target_compose_arch}" = "amd64" ]; then
119+
target_compose_arch="x86_64"
118120
fi
119-
if [ "${TARGET_COMPOSE_ARCH}" != "x86_64" ]; then
121+
if [ "${target_compose_arch}" != "x86_64" ]; then
120122
# Use pip to get a version that runns on this architecture
121123
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
122124
apt_get_update_if_needed
@@ -135,8 +137,8 @@ else
135137
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' docker-compose
136138
rm -rf /tmp/pip-tmp
137139
else
138-
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
139-
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-${TARGET_COMPOSE_ARCH}" -o /usr/local/bin/docker-compose
140+
latest_compose_version=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
141+
curl -fsSL "https://github.com/docker/compose/releases/download/${latest_compose_version}/docker-compose-$(uname -s)-${target_compose_arch}" -o /usr/local/bin/docker-compose
140142
chmod +x /usr/local/bin/docker-compose
141143
fi
142144
fi

script-library/docker-redhat.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fi
4343
if yum list deltarpm > /dev/null 2>&1; then
4444
yum -y install deltarpm
4545
fi
46-
yum -y install ca-certificates curl gnupg2 dnf net-tools dialog git openssh-clients curl less procps
46+
yum -y install ca-certificates curl gnupg2 dirmngr dnf net-tools dialog git openssh-clients curl less procps
4747

4848
# Try to load os-release
4949
. /etc/os-release 2>/dev/null

script-library/fish-debian.sh

100644100755
File mode changed.

script-library/git-from-src-debian.sh

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ receive_gpg_keys() {
7171
done
7272
set -e
7373
if [ "${gpg_ok}" = "false" ]; then
74-
echo "(!) Failed to install rvm."
74+
echo "(!) Failed to get gpg key."
7575
exit 1
7676
fi
7777
}
@@ -102,7 +102,7 @@ export DEBIAN_FRONTEND=noninteractive
102102
# If ubuntu, PPAs allowed, and latest - install from there
103103
if ([ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_VERSION}" = "current" ]) && [ "${ID}" = "ubuntu" ] && [ "${USE_PPA_IF_AVAILABLE}" = "true" ]; then
104104
echo "Using PPA to install latest git..."
105-
check_packages apt-transport-https curl ca-certificates gnupg2
105+
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
106106
receive_gpg_keys GIT_CORE_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/gitcoreppa-archive-keyring.gpg
107107
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-core-ppa.list
108108
apt-get update

0 commit comments

Comments
 (0)