compose: ERROR: client version 1.22 is too old

I’m trying to run https://github.com/docker/labs/blob/master/windows/windows-containers/MultiContainerApp.md using Docker-Compose with named pipes. It’s failing with an error about client API version:

PS C:\Source\Musicstore> docker-compose -f .\docker-compose.windows.yml up
ERROR: client version 1.22 is too old. Minimum supported API version is 1.25, please upgrade your client to a newer version
PS C:\Source\Musicstore> docker-compose -f .\docker-compose.windows.yml ps
ERROR: client version 1.22 is too old. Minimum supported API version is 1.25, please upgrade your client to a newer version

Here’s what I have installed:

docker-compose version

docker-compose version 1.9.0-rc2, build d41f869
docker-py version: 1.10.5
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016

docker version:

Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   877c860
 Built:        Thu Nov  3 04:06:20 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   877c860
 Built:        Thu Nov  3 04:06:20 2016
 OS/Arch:      windows/amd64
 Experimental: false

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 7
  • Comments: 35

Commits related to this issue

Most upvoted comments

Its kinda relevant and might help some people so I’m gonna post this here:

After recent “Docker for Windows” update or fresh install people get switched to Windows containers mode. If you are in this mode and try to run/build linux containers you’ll probably get errors like:

client version 1.22 is too old. Minimum supported API version is 1.24, please up grade your client to a newer version

or

image operating system linux cannot be used

Make sure you switch to Linux containers mode if you want to use linux containers. image

Maybe related with: #268

Try to change version: "2" to "version: "2.1" in you docker-compose.yml file.

Ok, I picked up builds of Docker/DockerD that have docker/docker#28072 fixed.

Based on the discussion there - I think that I should still be getting ERROR: client version 1.22 is too old. Minimum supported API version is 1.25, please upgrade your client because the docker-compose file has version: '2'. Instead, I get this:

PS C:\Users\Patrick\Source\Repos\MusicStore> docker-compose -f .\docker-compose.windows.yml build
db uses an image, skipping
Building web
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 65, in main
  File "compose\cli\main.py", line 117, in perform_command
  File "compose\cli\main.py", line 223, in build
  File "compose\project.py", line 300, in build
  File "compose\service.py", line 741, in build
  File "site-packages\docker\api\build.py", line 105, in build
  File "site-packages\docker\utils\decorators.py", line 47, in inner
  File "site-packages\docker\client.py", line 135, in _post
  File "site-packages\requests\sessions.py", line 522, in post
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1057, in request
  File "httplib.py", line 1097, in _send_request
  File "httplib.py", line 1053, in endheaders
  File "httplib.py", line 901, in _send_output
  File "httplib.py", line 870, in send
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 158, in sendall
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 153, in send
pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')
docker-compose returned -1

Why aren’t I getting the right error?

If I change it to version: '2.1', then it works as expected.

For reference, here’s the versions I’m using now:

PS C:\Users\Patrick\Source\Repos\MusicStore> docker-compose version
docker-compose version 1.9.0dev, build 9046e33
docker-py version: 1.10.6
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016
PS C:\Users\Patrick\Source\Repos\MusicStore> docker version
Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   c5ceb0f
 Built:        Sat Nov  5 03:24:43 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   c5ceb0f
 Built:        Sat Nov  5 03:24:43 2016
 OS/Arch:      windows/amd64
 Experimental: false

Nevermind my comment, after setting version to 2.1 it worked. But the error message could be a bit more specific

^^^ This is a fresh new install, and my first docker experience.

How is this easier again?

@PatrickLang Yes - you have to use 2.1 on Windows.

I’m getting the same issue with

Client: Version: 1.13.0-rc2 API version: 1.25 Go version: go1.7.3 Git commit: 1f9b3ef Built: Wed Nov 23 17:40:58 2016 OS/Arch: windows/amd64

Server: Version: 1.13.0-rc2 API version: 1.25 Minimum API version: 1.24 Go version: go1.7.3 Git commit: 1f9b3ef Built: Wed Nov 23 17:40:58 2016 OS/Arch: windows/amd64 Experimental: false

Switch to Linux Container is help me to resolve the issue

FYI - tried 2.1 and it fixed the issue for me. Thanks 😃

@shin- I still get the error when running docker-compose on docker for windows.

version: '2.1'

PS C:\> docker-compose version
docker-compose version 1.11.1, build 7afaa436
docker-py version: 2.0.2
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
PS C:\dev\Source\DevTools\Docker> docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.24)
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      windows/amd64
 Experimental: true
PS C:\dev\Source\DevTools\Docker> docker-compose -f .\docker-compose.windows.yml build
consul uses an image, skipping
sql uses an image, skipping
Building audittrail
Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 88, in main
  File "compose\cli\main.py", line 140, in perform_command
  File "compose\cli\main.py", line 247, in build
  File "compose\project.py", line 313, in build
  File "compose\service.py", line 804, in build
  File "site-packages\docker\api\build.py", line 205, in build
  File "site-packages\docker\utils\decorators.py", line 47, in inner
  File "site-packages\docker\api\client.py", line 175, in _post
  File "site-packages\requests\sessions.py", line 522, in post
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1042, in request
  File "httplib.py", line 1082, in _send_request
  File "httplib.py", line 1038, in endheaders
  File "httplib.py", line 886, in _send_output
  File "httplib.py", line 855, in send
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 159, in sendall
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 154, in send
pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')
Failed to execute script docker-compose

Clique com o botão direito do mouse no icone do docker e escolha a opção “switch to linux containers” como mencionado mais acima dos comentários

Got it resolved by changing the version to 2.1 everywhere, in all the docker-compose files.

Now I am getting this error when I am trying to run docker for windows on windows host

Error: image operating system linux cannot be used

Any suggestions? Thanks

I’m not having success with setting version: ‘2.1’ on my docker-compose.yml

It still claims my version is 1.21 with a minimum version of 1.24

$ docker version
Client:
 Version:      17.06.1-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 22:48:20 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.1-ce
 API version:  1.30 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   874a737
 Built:        Thu Aug 17 23:03:03 2017
 OS/Arch:      windows/amd64
 Experimental: true

$ docker-compose version
docker-compose version 1.14.0, build c7bdf9e3
docker-py version: 2.3.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
$ docker-compose up
client version 1.21 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

docker-compose.yml:

version: '2.1'

volumes:
    database_data:
        driver: local

services:
  nginx:
      image: nginx:latest
      ports:
          - 8080:80
      volumes:
          - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
      volumes_from:
          - php
  php:
      build: ./docker/php/
      expose:
          - 9000
      volumes:
          - .:/var/www/html
  mysql:
      image: mysql:latest
      expose:
          - 3306
      volumes:
          - database_data:/var/lib/mysql
      environment:
          MYSQL_ROOT_PASSWORD: secret
          MYSQL_DATABASE: project
          MYSQL_USER: project
          MYSQL_PASSWORD: project

@aberlin75 That error seems unrelated. Looks like a network issue similar to #4482

I still get the error trying to build a docker-compose.yml with version: "2.0" using Docker version v1.13-rc3 too.