docker-compose up leads to “client and server don't have same version (client : 1.14, server: 1.12)” error but client and server have the same version

后端 未结 9 2034
别那么骄傲
别那么骄傲 2020-12-08 06:22

docker version prints:

Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version:          


        
相关标签:
9条回答
  • 2020-12-08 06:57

    This is an issue of docker API version used by docker-compose being higher than that that of docker daemon listening to serve.

    Easiest way to fix is this to use an older version of docker-compose.

    Here is my example but with different version mismatch:

    $ docker-compose up
    
    client and server don't have same version (client : 1.18, server: 1.17)
    

    To fix it, I had to install a lower version of docker-compose(1.2 version instead of latest 1.3 version) using following command

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

    You can find different version of docker-compose at https://github.com/docker/compose/releases

    Based on your server version, you need to try different lower versioned docker-compose until one works.

    0 讨论(0)
  • 2020-12-08 07:03

    I tried a lot of solution but when I used sudo apt-get upgrade docker-engine I see message that I have installed docker with different name as docker-ce . After I fixed with sudo apt-get upgrade docker-ce.

    0 讨论(0)
  • 2020-12-08 07:06

    I found uninstalling the version installed with apt-get and downloading directly from latest version on their download page via command line wget seemed to work..

    0 讨论(0)
  • 2020-12-08 07:10

    I think you just need to use a newer version of Docker. Presumably client version 1.14 is used internally in Compose.

    Uninstall the apt-get version and follow the instructions on the Docker website to install Docker:

     wget -qO- https://get.docker.com/ | sh
    
    0 讨论(0)
  • 2020-12-08 07:11

    you can downgrade your docker-compose version,if you have installled your docker-compose by:

    pip install docker-compose

    you can uninstall it first by:

    pip uninstall docker-compose

    then,you can run:

    pip install docker-compose==1.3.0

    if you docker-compose up,still show the similar info,you can uninstall it(by pip uninstall docker-compose),and install a lower version docker-compose,such as:

    pip install docker-compose==1.2.0

    you can go on the loop, if still show the wrong info.

    ps:the detail version number can be found in https://github.com/docker/compose/releases

    0 讨论(0)
  • 2020-12-08 07:12

    Checkout the environment variable COMPOSE_API_VERSION.

    I was getting ERROR: client and server don't have same version (client : 1.19, server: 1.18), then I did export COMPOSE_API_VERSION=1.18 and problem sovled!

    0 讨论(0)
提交回复
热议问题