How to upgrade docker-compose to latest version

后端 未结 12 2231
遇见更好的自我
遇见更好的自我 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:36

    If you tried sudo apt-get remove docker-compose and get E: Unable to locate package docker-compose, try this method :

    This command must return a result, in order to check it is installed here :

    ls -l /usr/local/bin/docker-compose
    

    Remove the old version :

    sudo rm -rf docker-compose
    

    Download the last version (check official repo : docker/compose/releases) :

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

    (replace 1.24.0 if needed)

    Finally, apply executable permissions to the binary:

    sudo chmod +x /usr/local/bin/docker-compose
    

    Check version :

    docker-compose -v
    

提交回复
热议问题