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

Commit 7bf963a

Browse files
author
CI
committed
Automated update for script library changes
1 parent 47ec90c commit 7bf963a

File tree

11 files changed

+311
-61
lines changed

11 files changed

+311
-61
lines changed

containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md
88
# Maintainer: The VS Code and Codespaces Teams
99
#
10-
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version]
10+
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version] [Major version for docker-compose]
1111

1212
ENABLE_NONROOT_DOCKER=${1:-"true"}
1313
SOURCE_SOCKET=${2:-"/var/run/docker-host.sock"}
1414
TARGET_SOCKET=${3:-"/var/run/docker.sock"}
1515
USERNAME=${4:-"automatic"}
1616
USE_MOBY=${5:-"true"}
1717
DOCKER_VERSION=${6:-"latest"}
18+
DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2
1819
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
19-
DOCKER_DASH_COMPOSE_VERSION="1"
2020

2121
set -e
2222

@@ -206,13 +206,36 @@ else
206206
${pipx_bin} install --pip-args '--no-cache-dir --force-reinstall' docker-compose
207207
rm -rf /tmp/pip-tmp
208208
else
209-
find_version_from_git_tags DOCKER_DASH_COMPOSE_VERSION "https://github.com/docker/compose" "tags/"
210-
echo "(*) Installing docker-compose ${DOCKER_DASH_COMPOSE_VERSION}..."
211-
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_DASH_COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
209+
compose_v1_version="1"
210+
find_version_from_git_tags compose_v1_version "https://github.com/docker/compose" "tags/"
211+
echo "(*) Installing docker-compose ${compose_v1_version}..."
212+
curl -fsSL "https://github.com/docker/compose/releases/download/${compose_v1_version}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
212213
chmod +x /usr/local/bin/docker-compose
213214
fi
214215
fi
215216

217+
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
218+
current_v1_compose_path="$(which docker-compose)"
219+
target_v1_compose_path="$(dirname "${current_v1_compose_path}")/docker-compose-v1"
220+
if ! type compose-switch > /dev/null 2>&1; then
221+
echo "(*) Installing compose-switch..."
222+
compose_switch_version="latest"
223+
find_version_from_git_tags compose_switch_version "https://github.com/docker/compose-switch"
224+
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${architecture}" -o /usr/local/bin/compose-switch
225+
chmod +x /usr/local/bin/compose-switch
226+
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
227+
228+
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
229+
mv "${current_v1_compose_path}" "${target_v1_compose_path}"
230+
update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
231+
update-alternatives --install /usr/local/bin/docker-compose docker-compose "${target_v1_compose_path}" 1
232+
fi
233+
if [ "${DOCKER_DASH_COMPOSE_VERSION}" = "v1" ]; then
234+
update-alternatives --set docker-compose "${target_v1_compose_path}"
235+
else
236+
update-alternatives --set docker-compose /usr/local/bin/compose-switch
237+
fi
238+
216239
# If init file already exists, exit
217240
if [ -f "/usr/local/share/docker-init.sh" ]; then
218241
exit 0

containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md
88
# Maintainer: The VS Code and Codespaces Teams
99
#
10-
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version]
10+
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version] [Major version for docker-compose]
1111

1212
ENABLE_NONROOT_DOCKER=${1:-"true"}
1313
SOURCE_SOCKET=${2:-"/var/run/docker-host.sock"}
1414
TARGET_SOCKET=${3:-"/var/run/docker.sock"}
1515
USERNAME=${4:-"automatic"}
1616
USE_MOBY=${5:-"true"}
1717
DOCKER_VERSION=${6:-"latest"}
18+
DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2
1819
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
19-
DOCKER_DASH_COMPOSE_VERSION="1"
2020

2121
set -e
2222

@@ -206,13 +206,36 @@ else
206206
${pipx_bin} install --pip-args '--no-cache-dir --force-reinstall' docker-compose
207207
rm -rf /tmp/pip-tmp
208208
else
209-
find_version_from_git_tags DOCKER_DASH_COMPOSE_VERSION "https://github.com/docker/compose" "tags/"
210-
echo "(*) Installing docker-compose ${DOCKER_DASH_COMPOSE_VERSION}..."
211-
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_DASH_COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
209+
compose_v1_version="1"
210+
find_version_from_git_tags compose_v1_version "https://github.com/docker/compose" "tags/"
211+
echo "(*) Installing docker-compose ${compose_v1_version}..."
212+
curl -fsSL "https://github.com/docker/compose/releases/download/${compose_v1_version}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
212213
chmod +x /usr/local/bin/docker-compose
213214
fi
214215
fi
215216

217+
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
218+
current_v1_compose_path="$(which docker-compose)"
219+
target_v1_compose_path="$(dirname "${current_v1_compose_path}")/docker-compose-v1"
220+
if ! type compose-switch > /dev/null 2>&1; then
221+
echo "(*) Installing compose-switch..."
222+
compose_switch_version="latest"
223+
find_version_from_git_tags compose_switch_version "https://github.com/docker/compose-switch"
224+
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${architecture}" -o /usr/local/bin/compose-switch
225+
chmod +x /usr/local/bin/compose-switch
226+
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
227+
228+
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
229+
mv "${current_v1_compose_path}" "${target_v1_compose_path}"
230+
update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
231+
update-alternatives --install /usr/local/bin/docker-compose docker-compose "${target_v1_compose_path}" 1
232+
fi
233+
if [ "${DOCKER_DASH_COMPOSE_VERSION}" = "v1" ]; then
234+
update-alternatives --set docker-compose "${target_v1_compose_path}"
235+
else
236+
update-alternatives --set docker-compose /usr/local/bin/compose-switch
237+
fi
238+
216239
# If init file already exists, exit
217240
if [ -f "/usr/local/share/docker-init.sh" ]; then
218241
exit 0

containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md
88
# Maintainer: The VS Code and Codespaces Teams
99
#
10-
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version]
10+
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version] [Major version for docker-compose]
1111

1212
ENABLE_NONROOT_DOCKER=${1:-"true"}
1313
SOURCE_SOCKET=${2:-"/var/run/docker-host.sock"}
1414
TARGET_SOCKET=${3:-"/var/run/docker.sock"}
1515
USERNAME=${4:-"automatic"}
1616
USE_MOBY=${5:-"true"}
1717
DOCKER_VERSION=${6:-"latest"}
18+
DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2
1819
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
19-
DOCKER_DASH_COMPOSE_VERSION="1"
2020

2121
set -e
2222

@@ -206,13 +206,36 @@ else
206206
${pipx_bin} install --pip-args '--no-cache-dir --force-reinstall' docker-compose
207207
rm -rf /tmp/pip-tmp
208208
else
209-
find_version_from_git_tags DOCKER_DASH_COMPOSE_VERSION "https://github.com/docker/compose" "tags/"
210-
echo "(*) Installing docker-compose ${DOCKER_DASH_COMPOSE_VERSION}..."
211-
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_DASH_COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
209+
compose_v1_version="1"
210+
find_version_from_git_tags compose_v1_version "https://github.com/docker/compose" "tags/"
211+
echo "(*) Installing docker-compose ${compose_v1_version}..."
212+
curl -fsSL "https://github.com/docker/compose/releases/download/${compose_v1_version}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
212213
chmod +x /usr/local/bin/docker-compose
213214
fi
214215
fi
215216

217+
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
218+
current_v1_compose_path="$(which docker-compose)"
219+
target_v1_compose_path="$(dirname "${current_v1_compose_path}")/docker-compose-v1"
220+
if ! type compose-switch > /dev/null 2>&1; then
221+
echo "(*) Installing compose-switch..."
222+
compose_switch_version="latest"
223+
find_version_from_git_tags compose_switch_version "https://github.com/docker/compose-switch"
224+
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${architecture}" -o /usr/local/bin/compose-switch
225+
chmod +x /usr/local/bin/compose-switch
226+
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
227+
228+
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
229+
mv "${current_v1_compose_path}" "${target_v1_compose_path}"
230+
update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
231+
update-alternatives --install /usr/local/bin/docker-compose docker-compose "${target_v1_compose_path}" 1
232+
fi
233+
if [ "${DOCKER_DASH_COMPOSE_VERSION}" = "v1" ]; then
234+
update-alternatives --set docker-compose "${target_v1_compose_path}"
235+
else
236+
update-alternatives --set docker-compose /usr/local/bin/compose-switch
237+
fi
238+
216239
# If init file already exists, exit
217240
if [ -f "/usr/local/share/docker-init.sh" ]; then
218241
exit 0

containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker-in-docker.md
88
# Maintainer: The VS Code and Codespaces Teams
99
#
10-
# Syntax: ./docker-in-docker-debian.sh [enable non-root docker access flag] [non-root user] [use moby] [Engine/CLI Version]
10+
# Syntax: ./docker-in-docker-debian.sh [enable non-root docker access flag] [non-root user] [use moby] [Engine/CLI Version] [Major version for docker-compose]
1111

1212
ENABLE_NONROOT_DOCKER=${1:-"true"}
1313
USERNAME=${2:-"automatic"}
1414
USE_MOBY=${3:-"true"}
1515
DOCKER_VERSION=${4:-"latest"} # The Docker/Moby Engine + CLI should match in version
16+
DOCKER_DASH_COMPOSE_VERSION=${5:-"v1"} # v1 or v2
1617
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
17-
DOCKER_DASH_COMPOSE_VERSION="1"
1818

1919
set -e
2020

@@ -193,7 +193,7 @@ echo "Finished installing docker / moby!"
193193

194194
# Install Docker Compose if not already installed and is on a supported architecture
195195
if type docker-compose > /dev/null 2>&1; then
196-
echo "Docker Compose already installed."
196+
echo "Docker Compose v1 already installed."
197197
else
198198
target_compose_arch="${architecture}"
199199
if [ "${target_compose_arch}" = "amd64" ]; then
@@ -218,14 +218,36 @@ else
218218
${pipx_bin} install --pip-args '--no-cache-dir --force-reinstall' docker-compose
219219
rm -rf /tmp/pip-tmp
220220
else
221-
# Only supports docker-compose v1
222-
find_version_from_git_tags DOCKER_DASH_COMPOSE_VERSION "https://github.com/docker/compose" "tags/"
223-
echo "(*) Installing docker-compose ${DOCKER_DASH_COMPOSE_VERSION}..."
224-
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_DASH_COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
221+
compose_v1_version="1"
222+
find_version_from_git_tags compose_v1_version "https://github.com/docker/compose" "tags/"
223+
echo "(*) Installing docker-compose ${compose_v1_version}..."
224+
curl -fsSL "https://github.com/docker/compose/releases/download/${compose_v1_version}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
225225
chmod +x /usr/local/bin/docker-compose
226226
fi
227227
fi
228228

229+
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
230+
current_v1_compose_path="$(which docker-compose)"
231+
target_v1_compose_path="$(dirname "${current_v1_compose_path}")/docker-compose-v1"
232+
if ! type compose-switch > /dev/null 2>&1; then
233+
echo "(*) Installing compose-switch..."
234+
compose_switch_version="latest"
235+
find_version_from_git_tags compose_switch_version "https://github.com/docker/compose-switch"
236+
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${architecture}" -o /usr/local/bin/compose-switch
237+
chmod +x /usr/local/bin/compose-switch
238+
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
239+
240+
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
241+
mv "${current_v1_compose_path}" "${target_v1_compose_path}"
242+
update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
243+
update-alternatives --install /usr/local/bin/docker-compose docker-compose "${target_v1_compose_path}" 1
244+
fi
245+
if [ "${DOCKER_DASH_COMPOSE_VERSION}" = "v1" ]; then
246+
update-alternatives --set docker-compose "${target_v1_compose_path}"
247+
else
248+
update-alternatives --set docker-compose /usr/local/bin/compose-switch
249+
fi
250+
229251
# If init file already exists, exit
230252
if [ -f "/usr/local/share/docker-init.sh" ]; then
231253
echo "/usr/local/share/docker-init.sh already exists, so exiting."

containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md
88
# Maintainer: The VS Code and Codespaces Teams
99
#
10-
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version]
10+
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version] [Major version for docker-compose]
1111

1212
ENABLE_NONROOT_DOCKER=${1:-"true"}
1313
SOURCE_SOCKET=${2:-"/var/run/docker-host.sock"}
1414
TARGET_SOCKET=${3:-"/var/run/docker.sock"}
1515
USERNAME=${4:-"automatic"}
1616
USE_MOBY=${5:-"true"}
1717
DOCKER_VERSION=${6:-"latest"}
18+
DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2
1819
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
19-
DOCKER_DASH_COMPOSE_VERSION="1"
2020

2121
set -e
2222

@@ -206,13 +206,36 @@ else
206206
${pipx_bin} install --pip-args '--no-cache-dir --force-reinstall' docker-compose
207207
rm -rf /tmp/pip-tmp
208208
else
209-
find_version_from_git_tags DOCKER_DASH_COMPOSE_VERSION "https://github.com/docker/compose" "tags/"
210-
echo "(*) Installing docker-compose ${DOCKER_DASH_COMPOSE_VERSION}..."
211-
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_DASH_COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
209+
compose_v1_version="1"
210+
find_version_from_git_tags compose_v1_version "https://github.com/docker/compose" "tags/"
211+
echo "(*) Installing docker-compose ${compose_v1_version}..."
212+
curl -fsSL "https://github.com/docker/compose/releases/download/${compose_v1_version}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
212213
chmod +x /usr/local/bin/docker-compose
213214
fi
214215
fi
215216

217+
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
218+
current_v1_compose_path="$(which docker-compose)"
219+
target_v1_compose_path="$(dirname "${current_v1_compose_path}")/docker-compose-v1"
220+
if ! type compose-switch > /dev/null 2>&1; then
221+
echo "(*) Installing compose-switch..."
222+
compose_switch_version="latest"
223+
find_version_from_git_tags compose_switch_version "https://github.com/docker/compose-switch"
224+
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${architecture}" -o /usr/local/bin/compose-switch
225+
chmod +x /usr/local/bin/compose-switch
226+
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
227+
228+
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
229+
mv "${current_v1_compose_path}" "${target_v1_compose_path}"
230+
update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
231+
update-alternatives --install /usr/local/bin/docker-compose docker-compose "${target_v1_compose_path}" 1
232+
fi
233+
if [ "${DOCKER_DASH_COMPOSE_VERSION}" = "v1" ]; then
234+
update-alternatives --set docker-compose "${target_v1_compose_path}"
235+
else
236+
update-alternatives --set docker-compose /usr/local/bin/compose-switch
237+
fi
238+
216239
# If init file already exists, exit
217240
if [ -f "/usr/local/share/docker-init.sh" ]; then
218241
exit 0

containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md
88
# Maintainer: The VS Code and Codespaces Teams
99
#
10-
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version]
10+
# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version] [Major version for docker-compose]
1111

1212
ENABLE_NONROOT_DOCKER=${1:-"true"}
1313
SOURCE_SOCKET=${2:-"/var/run/docker-host.sock"}
1414
TARGET_SOCKET=${3:-"/var/run/docker.sock"}
1515
USERNAME=${4:-"automatic"}
1616
USE_MOBY=${5:-"true"}
1717
DOCKER_VERSION=${6:-"latest"}
18+
DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2
1819
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
19-
DOCKER_DASH_COMPOSE_VERSION="1"
2020

2121
set -e
2222

@@ -206,13 +206,36 @@ else
206206
${pipx_bin} install --pip-args '--no-cache-dir --force-reinstall' docker-compose
207207
rm -rf /tmp/pip-tmp
208208
else
209-
find_version_from_git_tags DOCKER_DASH_COMPOSE_VERSION "https://github.com/docker/compose" "tags/"
210-
echo "(*) Installing docker-compose ${DOCKER_DASH_COMPOSE_VERSION}..."
211-
curl -fsSL "https://github.com/docker/compose/releases/download/${DOCKER_DASH_COMPOSE_VERSION}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
209+
compose_v1_version="1"
210+
find_version_from_git_tags compose_v1_version "https://github.com/docker/compose" "tags/"
211+
echo "(*) Installing docker-compose ${compose_v1_version}..."
212+
curl -fsSL "https://github.com/docker/compose/releases/download/${compose_v1_version}/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
212213
chmod +x /usr/local/bin/docker-compose
213214
fi
214215
fi
215216

217+
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
218+
current_v1_compose_path="$(which docker-compose)"
219+
target_v1_compose_path="$(dirname "${current_v1_compose_path}")/docker-compose-v1"
220+
if ! type compose-switch > /dev/null 2>&1; then
221+
echo "(*) Installing compose-switch..."
222+
compose_switch_version="latest"
223+
find_version_from_git_tags compose_switch_version "https://github.com/docker/compose-switch"
224+
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${architecture}" -o /usr/local/bin/compose-switch
225+
chmod +x /usr/local/bin/compose-switch
226+
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
227+
228+
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
229+
mv "${current_v1_compose_path}" "${target_v1_compose_path}"
230+
update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
231+
update-alternatives --install /usr/local/bin/docker-compose docker-compose "${target_v1_compose_path}" 1
232+
fi
233+
if [ "${DOCKER_DASH_COMPOSE_VERSION}" = "v1" ]; then
234+
update-alternatives --set docker-compose "${target_v1_compose_path}"
235+
else
236+
update-alternatives --set docker-compose /usr/local/bin/compose-switch
237+
fi
238+
216239
# If init file already exists, exit
217240
if [ -f "/usr/local/share/docker-init.sh" ]; then
218241
exit 0

0 commit comments

Comments
 (0)