Compose: Add an url for latest version for easy Linux upgrade

Created on 6 Oct 2016  路  6Comments  路  Source: docker/compose

I'd like to use a script to automatically upgrade docker-compose聽regularly. Currently, I can't find a static url with latest tag, and need to manually edit the 1.8.0 tag.

curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

Could there be made available a latest tag for this purpose?

Most helpful comment

bash workaround:

#!/bin/bash

# get latest version
LATEST=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/docker/compose/releases/latest)
VERSION=$(echo $LATEST | sed 's:.*/::')

echo Updating Docker Compose to $VERSION

# download
curl -L https://github.com/docker/compose/releases/download/$VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version

All 6 comments

bash workaround:

#!/bin/bash

# get latest version
LATEST=$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/docker/compose/releases/latest)
VERSION=$(echo $LATEST | sed 's:.*/::')

echo Updating Docker Compose to $VERSION

# download
curl -L https://github.com/docker/compose/releases/download/$VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version

There are repos for Ubuntu/Debian at https://download.docker.com/linux/....

Could it be an idea to create an up-to-date docker-compose package there, in the same way that there is an up-to-date docker-ce package there?

EDIT: This idea is a duplicate of #2235.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@knutole, it's now possible. I don't think it was previously.

This works:

$ curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose

This issue has been automatically marked as not stale anymore due to the recent activity.

@aude solution works well

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bergtwvd picture bergtwvd  路  3Comments

foxx picture foxx  路  3Comments

guycalledseven picture guycalledseven  路  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  3Comments

DhairyashilBhosale picture DhairyashilBhosale  路  3Comments