How to upgrade docker-compose to latest version

I have installed docker-compose using the command

sudo apt install docker-compose

It installed docker-compose version 1.8.0 and build unknown

I need the latest version of docker-compose or at least a version of 1.9.0

Can anyone please let me know what approach I should take to upgrade it or uninstall and re-install the latest version.

I have checked the docker website and can see that they are recommending this to install the latest version’

sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

But before that, I have to uninstall the present version, which can be done using the command

sudo rm /usr/local/bin/docker-compose

but this can be used only when the installation was done using curl. I am not sure if the installation was done by curl as I have used

sudo apt install docker-compose

Please let me know what should I do now to uninstall and re-install the docker-compose.

21 Answers
21

Leave a Comment