Skip to content

Instantly share code, notes, and snippets.

@garcia556
Last active November 22, 2017 04:26
Show Gist options
  • Save garcia556/824b0c2b475464de596aaff1e4591010 to your computer and use it in GitHub Desktop.
Save garcia556/824b0c2b475464de596aaff1e4591010 to your computer and use it in GitHub Desktop.
Install the latest version available of docker-compose
#!/bin/bash
# installs latest docker-compose version
# - works on Linux; on macOS there is a brew package for it
# - requires root permissions
# get latest version
VER=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep "tag_name" | cut -d\" -f4)
# get bin
BIN="/usr/local/bin/docker-compose"
curl -L https://github.com/docker/compose/releases/download/${VER}/docker-compose-`uname -s`-`uname -m` > ${BIN}
chmod +x ${BIN}
# get completion
curl -L https://raw.githubusercontent.com/docker/compose/${VER}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose
docker-compose -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment