Skip to content

Instantly share code, notes, and snippets.

@br4instormer
Last active September 20, 2024 13:49
Show Gist options
  • Save br4instormer/c4647e19b09218c6d10615f67bda676d to your computer and use it in GitHub Desktop.
Save br4instormer/c4647e19b09218c6d10615f67bda676d to your computer and use it in GitHub Desktop.
Update user-wide docker compose plugin

Update docker compose plugin on local user environment

Installation

  1. Place script into ~/bin
  2. Put ~/bin to your local PATH environment if necessary
  3. Set permissions on launch: chmod u+x docker-compose-update.sh
  4. Install dependencies:
  • wget
  • curl
  • jq

Usage

# will be downloaded last version released on github
docker-compose-update.sh

Check plugin installed correct

docker system info -f '{{ json .ClientInfo.Plugins }}' | jq '.[] | select(.Name=="compose")'
#!/usr/bin/env bash
set -o pipefail
curl -fs "https://api.github.com/repos/docker/compose/releases?per_page=1&page=1" \
| jq -r '.[0].assets[] | select(.name == "docker-compose-linux-x86_64") | .browser_download_url' \
| wget -O ~/.docker/cli-plugins/docker-compose --show-progress --progress bar -q -i - \
&& chmod u+x ~/.docker/cli-plugins/docker-compose \
&& docker compose version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment