Skip to content

Instantly share code, notes, and snippets.

@mohemohe
Last active October 30, 2022 06:22
Show Gist options
  • Save mohemohe/a8b7a3c910b235f31a25b653855fc91b to your computer and use it in GitHub Desktop.
Save mohemohe/a8b7a3c910b235f31a25b653855fc91b to your computer and use it in GitHub Desktop.
install/update docker compose v2
#!/bin/bash -x
if [[ "${COMPOSE_VERSION}" == "" ]]; then
echo "must be set env 'COMPOSE_VERSION'"
exit 1
fi
OS="$(uname -s | awk '{print tolower($0)}')"
ARCH="$(uname -m)"
mkdir -p /usr/local/lib/docker/cli-plugins
rm -f /usr/local/lib/docker/cli-plugins/docker-compose
curl -SL "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-${OS}-${ARCH}" -o /usr/local/lib/docker/cli-plugins/docker-compose
chmod a+x /usr/local/lib/docker/cli-plugins/docker-compose
@mohemohe
Copy link
Author

mohemohe commented Jan 11, 2022

To install:

curl -L https://gistcdn.githack.com/mohemohe/a8b7a3c910b235f31a25b653855fc91b/raw/install_docker-compose.sh | sudo env COMPOSE_VERSION=v2.12.2 bash -x

@mohemohe
Copy link
Author

mohemohe commented Jul 8, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment