@@ -76,7 +76,7 @@ check_packages() {
76
76
export DEBIAN_FRONTEND=noninteractive
77
77
78
78
# 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
80
80
81
81
# Swap to legacy iptables for compatibility
82
82
if type iptables-legacy > /dev/null 2>&1 ; then
@@ -85,6 +85,7 @@ if type iptables-legacy > /dev/null 2>&1; then
85
85
fi
86
86
87
87
# Install Docker / Moby CLI if not already installed
88
+ architecture=" $( dpkg --print-architecture) "
88
89
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1 ; then
89
90
echo " Docker / Moby CLI and Engine already installed."
90
91
else
94
95
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
95
96
get_common_setting MICROSOFT_GPG_KEYS_URI
96
97
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
98
99
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."
100
102
else
101
103
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
102
104
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"
112
114
if type docker-compose > /dev/null 2>&1 ; then
113
115
echo " Docker Compose already installed."
114
116
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"
118
120
fi
119
- if [ " ${TARGET_COMPOSE_ARCH } " != " x86_64" ]; then
121
+ if [ " ${target_compose_arch } " != " x86_64" ]; then
120
122
# Use pip to get a version that runns on this architecture
121
123
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1 ; then
122
124
apt_get_update_if_needed
135
137
${pipx_bin} install --system-site-packages --pip-args ' --no-cache-dir --force-reinstall' docker-compose
136
138
rm -rf /tmp/pip-tmp
137
139
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
140
142
chmod +x /usr/local/bin/docker-compose
141
143
fi
142
144
fi
0 commit comments