Last active
March 2, 2023 16:49
-
-
Save sergio-gimenez/c5910d112e677d81c8107344b560b73b to your computer and use it in GitHub Desktop.
Install/update docker-compose to last release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Reference: https://stackoverflow.com/questions/49839028/how-to-upgrade-docker-compose-to-latest-version | |
| # First, remove the old version: | |
| # - If installed via apt-get | |
| # sudo apt-get remove docker-compose | |
| # - If installed via curl | |
| # sudo rm /usr/local/bin/docker-compose | |
| # - If installed via pip | |
| # pip uninstall docker-compose | |
| # Find last version from github | |
| VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | grep -Po '"tag_name": "\K.*\d') | |
| # Finally, download to your favorite $PATH-accessible location and set permissions: | |
| DESTINATION=/usr/local/bin/docker-compose | |
| # TODO that curl gives error in zsh but works correctly on bash | |
| sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION | |
| sudo chmod 755 $DESTINATION | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment