-
-
Save deviantony/2b5078fe1675a5fedabf1de3d1f2652a to your computer and use it in GitHub Desktop.
| #!/bin/bash | |
| ## THIS IS THE OLD WAY | |
| ## Nowadays, simply follow the Compose installation instructions in the official documentation: | |
| ## https://docs.docker.com/compose/install/ | |
| # get latest docker compose released tag | |
| COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4) | |
| # Install docker-compose | |
| sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" | |
| chmod +x /usr/local/bin/docker-compose | |
| sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose" | |
| # Output compose version | |
| docker-compose -v | |
| exit 0 |
If you do not want to use v2 you can use the following:
curl -s https://api.github.com/repos/docker/compose/releases | grep -e 'tag_name\": "1.' | cut -d\" -f4 | head -n 1
@withakay thanks it works! 👍
This is a 6y old gist :)
There's an easy way to install Compose nowadays in their documentation, I'd recommend using this approach instead: https://docs.docker.com/compose/install/
Thanks,
That was a piece of cake :)
Docker Desktop includes docker-compose these days, https://docs.docker.com/compose/install/compose-desktop/
Docker Desktop includes docker-compose these days, https://docs.docker.com/compose/install/compose-desktop/
You can even link docker-compose to the compose plugin in the docker folder for compatibility.
ln -s /usr/local/bin/docker-compose /usr/libexec/docker/cli-plugin/docker-compose
Thanks so much!
Great!! Thanks a lot!!!
perhaps hash -r?
👍
Thanks a lot, still working in 2024
THANK YOU WORKING IN 3-2025
This s so awesome thank you so very much for the script.