How to Upgrade Docker-Compose

How to Upgrade Docker-Compose

My Ubuntu 20.04 installs version 1.25.0 of docker-compose while the most recent version is 2.0.1 (why is that?).

Is there any method to force Ubuntu to install the latest version?

If not, so I have to follow the official instructions, but the curl command is pointing to /usr/local/bin directory while on my machine it is installed on /usr/bin.

So what is the safe method to upgrade my package?

5

2 Answers

Docker-compose takes place only in a binary file, so it is easy to put the last version !
First, if you have a previous installed version, remove it, in my case, I had version from main repository, so I ran :
sudo apt remove docker-compose
then go to and download, for example, for 2.2.3 : 
or other one
then move this file to :
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
and
sudo chmod +x /usr/local/bin/docker-compose
check d-c runs correctly :  docker-compose --version
that returns in my case : Docker Compose version v2.2.3

Under ubuntu 18.04, official docker are today at v19.03.13 and it is ok to work with compose v2

See also :

1

You are using an older release of Ubuntu, which generally runs older software. To run newer software, use a newer release of Ubuntu.

See Why don't the Ubuntu repositories have the latest versions of software?.

Note that the newest deb package for docker-compose is 1.27.
nobody has packaged 2.0.1 yet.

The BEST way to get newer deb packages is to help the Debian volunteers package it.

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.