Skip to content

Instantly share code, notes, and snippets.

@gartisk
Last active November 1, 2023 23:45
Show Gist options
  • Save gartisk/07614a3ad918a5951ccf0d7ea60bb17b to your computer and use it in GitHub Desktop.
Save gartisk/07614a3ad918a5951ccf0d7ea60bb17b to your computer and use it in GitHub Desktop.
#!/bin/bash
# sudo curl -fsSL <this_script_raw_path> | bash
# Change to latest version from https://github.com/docker/compose/releases
DOCKER_COMPOSE_VERSION="v2.23.0"
# Check if Docker Compose is already installed
if [ -x "$(command -v docker-compose)" ]; then
echo "Docker Compose is already installed."
exit 1;
fi
# Define the version you want to install
VERSION="v2.23.0" # Replace with the desired version
# Download Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# Make Docker Compose executable
sudo chmod +x /usr/local/bin/docker-compose
# Verify installation
if [ -x "$(command -v docker-compose)" ]; then
echo "Docker Compose $VERSION has been successfully installed."
else
echo "Failed to install Docker Compose."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment