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

Commit 14b8052

Browse files
committed
Install compose cli plugin in addition to compose-cli binary with scripted install
Signed-off-by: Guillaume Tardif <[email protected]>
1 parent ad42fc6 commit 14b8052

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

scripts/install/install_linux.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ if [ $(is_new_cli "docker") -eq 1 ]; then
120120
$sh_c "${download_cmd} ${download_dir}/docker-compose-cli.tar.gz ${DOWNLOAD_URL}"
121121
$sh_c "tar xzf ${download_dir}/docker-compose-cli.tar.gz -C ${download_dir} --strip-components 1"
122122
$sudo_sh_c "install -m 775 ${download_dir}/docker /usr/local/bin/docker"
123+
$sh_c "mkdir -p ~/.docker/cli-plugins && cp ${download_dir}/docker-compose ~/.docker/cli-plugins/docker-compose"
123124
exit 0
124125
fi
125126
echo "You already have the Docker Compose CLI installed, in a different location."
@@ -185,6 +186,8 @@ $sudo_sh_c "ln -s ${existing_cli_path} ${link_path}"
185186

186187
# Install downloaded CLI
187188
$sudo_sh_c "install -m 775 ${download_dir}/docker /usr/local/bin/docker"
189+
# Install Compose CLI plugin
190+
$sh_c "mkdir -p ~/.docker/cli-plugins && cp ${download_dir}/docker-compose ~/.docker/cli-plugins/docker-compose"
188191

189192
# Clear cache
190193
cleared_cache=1

scripts/install/test.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ RUN sudo chmod +x /scripts/install_linux.sh
3737
ARG DOWNLOAD_URL=
3838
RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh
3939
RUN docker version | grep Cloud
40+
RUN sh -c "docker info || true" | grep "compose: Docker Compose (Docker Inc.,"
4041

4142
FROM install AS upgrade
4243

@@ -45,6 +46,7 @@ WORKDIR /home/newuser
4546

4647
RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh
4748
RUN docker version | grep Cloud
49+
RUN sh -c "docker info || true" | grep "compose: Docker Compose (Docker Inc.,"
4850

4951
# To run this test locally, start an HTTP server that serves the dist/ folder
5052
# then run a docker build passing the DOWNLOAD_URL as a build arg:

0 commit comments

Comments
 (0)