Skip to content

Instantly share code, notes, and snippets.

@JBGruber
Last active April 25, 2023 20:48
Show Gist options
  • Save JBGruber/db4de49ee106889b969a277f800c05b8 to your computer and use it in GitHub Desktop.
Save JBGruber/db4de49ee106889b969a277f800c05b8 to your computer and use it in GitHub Desktop.
Update docker compose on Linux
#! /usr/bin/bash
# query the newes version of docker-compose and add to a path folder
latest=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name')
sudo curl -L "https://github.com/docker/compose/releases/download/$latest/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo "$(docker-compose --version) installed"
@JBGruber
Copy link
Author

JBGruber commented Apr 25, 2023

Use with:

wget https://gist.github.com/JBGruber/db4de49ee106889b969a277f800c05b8/raw/9ca5cbff672ef9f44c1bb529a781a4c59fce8f9e/update-compose-ubuntu-debian.sh
chmod +x update-compose-ubuntu-debian.sh
bash update-compose-ubuntu-debian.sh

In one line:

wget https://gist.github.com/JBGruber/db4de49ee106889b969a277f800c05b8/raw/9ca5cbff672ef9f44c1bb529a781a4c59fce8f9e/update-compose-ubuntu-debian.sh && \
  chmod +x update-compose-ubuntu-debian.sh && \
  bash update-compose-ubuntu-debian.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment