Friday 7 January 2022

How to upgrade docker-compose on Linux

Let's check the version of currently installed docker-compose:
 
$ docker-compose --version
docker-compose version 1.27.4, build 40524192

 
Let's verify the path to executable:

$ which docker-compose
/usr/local/bin/docker-compose

To upgrade docker-compose, we first need to remove the old version:

$ sudo rm /usr/local/bin/docker-compose
[sudo] password for user: 
 
We can then download the binary of the latest stable version (1.29.2 at time of writing)
 
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   664  100   664    0     0   2114      0 --:--:-- --:--:-- --:--:--  2121
100 12.1M  100 12.1M    0     0  2544k      0  0:00:04  0:00:04 --:--:-- 2723k

 
Add permissions to execute the newly downloaded binary: 

$ sudo chmod +x /usr/local/bin/docker-compose
 
Let's verify the new version:
 
$ docker-compose --version
docker-compose version 1.29.2, build 5becea4c

References


No comments: