Skip to content

Instantly share code, notes, and snippets.

@imWildCat
Created June 26, 2024 21:06
Show Gist options
  • Save imWildCat/759cac673e1c7a879c33d297c5a3d5b7 to your computer and use it in GitHub Desktop.
Save imWildCat/759cac673e1c7a879c33d297c5a3d5b7 to your computer and use it in GitHub Desktop.
compose_release() {
curl --silent "https://api.github.com/repos/docker/compose/releases/latest" |
grep -Po '"tag_name": "\K.*?(?=")'
}
if ! [ -x "$(command -v docker-compose)" ]; then
sudo curl -L https://github.com/docker/compose/releases/download/$(compose_release)/docker-compose-$(uname -s)-$(uname -m) \
-o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment