How to upgrade docker-compose to latest version

后端 未结 12 2212
遇见更好的自我
遇见更好的自我 2020-12-23 09:05

I have installed docker-compose using the command

sudo apt install docker-compose

It installed docker-compose version 1.8.0 and build unknown

12条回答
  •  执笔经年
    2020-12-23 09:22

    After a lot of looking at ways to perform this I ended up using jq, and hopefully I can expand it to handle other repos beyond Docker-Compose without too much work.

    # If you have jq installed this will automatically find the latest release binary for your architecture and download it
    curl --silent "https://api.github.com/repos/docker/compose/releases/latest" | jq --arg PLATFORM_ARCH "$(echo `uname -s`-`uname -m`)" -r '.assets[] | select(.name | endswith($PLATFORM_ARCH)).browser_download_url' | xargs sudo curl -L -o /usr/local/bin/docker-compose --url
    

提交回复
热议问题