Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a

docker-compose --version prints:

docker-compose 1.2.0

I installed docker with apt-get install docker.io and docker-compose with

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

I use Ubuntu 14.04 x64.

like image 761
Donovan Avatar asked Apr 19 '15 07:04

Donovan


4 Answers

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!

like image 76
hba Avatar answered Nov 11 '22 22:11

hba


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.

like image 39
Srini Koganti Avatar answered Nov 11 '22 23:11

Srini Koganti


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
like image 15
Adrian Mouat Avatar answered Nov 11 '22 23:11

Adrian Mouat


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.

like image 4
Anton Avatar answered Nov 11 '22 23:11

Anton