Useful or not, from you.
for-win OSError: [Errno 22] Invalid argument in docker-compose in v2.0.0

<!-- Please, check https://docs.docker.com/docker-for-windows/troubleshoot/. Issues without logs and details cannot be debugged, and will be closed.

Issues unrelated to Docker for Windows will be closed. In particular, see

  • https://github.com/docker/compose/issues for docker-compose
  • https://github.com/docker/machine/issues for docker-machine
  • https://github.com/moby/moby/issues for Docker daemon
  • https://github.com/docker/docker.github.io/issues for the documentation -->

<!-- Replace - [ ] with - [x], or click after having submitted the issue. -->

  • [X] I have tried with the latest version of my channel (Stable or Edge)
  • [X] I have uploaded Diagnostics
  • Diagnostics ID: 1E6E2498-3C44-42F1-AC6E-7C66643F6F92/20181120131213

Expected behavior

Docker-compose starts my environment.

Actual behavior

Docker-compose errors out and exits. See "Steps to reproduce the behavior" below.

Information

<!-- Please, help us understand the problem. For instance:

  • Is it reproducible?
  • Is the problem new?
  • Did the problem appear with an update?
  • A reproducible case if this is a bug, Dockerfiles FTW. -->
  • Windows Version: 10.0.17134 Build 17134
  • Docker for Windows Version: Version 2.0.0.0-win78 (28905) Channel: stable Build: c404a62

This worked yesterday for me, not for my co-worker. Then I updated Docker for Windows, and it stopped working for me too. This leads me to believe it has to do with the update and the new version.

It is reproducible by following the steps below.

Steps to reproduce the behavior

  1. Unpack testcase.zip.
  2. Go to docker/env.
  3. Run docker-compose up --build.

For me, on Windows, this is the output:

Building package-backend
[3944] Failed to execute script docker-compose
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 71, in main
  File "compose\cli\main.py", line 127, in perform_command
  File "compose\cli\main.py", line 1080, in up
  File "compose\cli\main.py", line 1076, in up
  File "compose\project.py", line 475, in up
  File "compose\service.py", line 340, in ensure_image_exists
  File "compose\service.py", line 1080, in build
  File "site-packages\docker\api\build.py", line 152, in build
  File "site-packages\docker\api\build.py", line 346, in process_dockerfile
OSError: [Errno 22] Invalid argument: '\\\\?\\C:\\Users\\[redacted username]\\code\\testcase\\docker\\env\\../backend/package.Dockerfile'

On OSX, this is the output:

Building package-backend
Step 1/1 : FROM alpine
latest: Pulling from library/alpine
4fe2ade4980c: Already exists
Digest: sha256:621c2f39f8133acb8e64023a94dbdf0d5ca81896102b9e57c0dc184cadaf5528
Status: Downloaded newer image for alpine:latest
 ---> 196d12cf6ab1
Successfully built 196d12cf6ab1
Successfully tagged env_package-backend:latest
Recreating env_package-backend_1 ... done
Attaching to env_package-backend_1
env_package-backend_1 exited with code 0 
```'


That's a useful answer
Without any help

Same problem on Docker Compose 1.24.1.

PS I:\projects\multilingualpress> docker-compose up
Building codecept
Traceback (most recent call last):
  File "site-packages\docker\utils\build.py", line 96, in create_archive
OSError: [Errno 22] Invalid argument: '\\\\?\\I:\\projects\\multilingualpress\\vendor\\bin\\export-plural-rules'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 71, in main
  File "compose\cli\main.py", line 127, in perform_command
  File "compose\cli\main.py", line 1085, in up
  File "compose\cli\main.py", line 1081, in up
  File "compose\project.py", line 527, in up
  File "compose\service.py", line 360, in ensure_image_exists
  File "compose\service.py", line 1084, in build
  File "site-package

Same here, Docker Compose 1.24.1.

Traceback (most recent call last):
  File "site-packages\docker\utils\build.py", line 96, in create_archive
OSError: [Errno 22] Invalid argument: '\\\\?\\E:\\project\\some_project\\modules\\main\\.pipenv\\bin\\python'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 71, in main
  File "compose\cli\main.py", line 127, in perform_command
  File "compose\cli\main.py", line 1085, in up
  File "compose\cli\main.py", line 1081, in up
  File "compose\project.py", line 527, in up
  File "compose\service.py", line 344, in ensure_image_exists
  File "compose\service.py", line 1084, in build
  File "site-packages\docker\api\build.py", line 159, in build
  File "site-packages\docker\utils\build.py", line 31, in tar
  File "site-packages\docker\utils\build.py", line 100, in create_archive
OSError: Can not read file in context: \\?\E:\project\some_project\modules\main\.pipenv\bin\python
[3844] Failed to execute script docker-compose