Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose crashes on relative paths after release #6356

Closed
ZParanoya opened this issue Nov 20, 2018 · 11 comments
Closed

compose crashes on relative paths after release #6356

ZParanoya opened this issue Nov 20, 2018 · 11 comments

Comments

@ZParanoya
Copy link

ZParanoya commented Nov 20, 2018

Description of the issue

Receive a stack trace on build when relative paths are used in the build config. The release prior to this worked fine. I didn't get the version number, but I kept updating with every version that was being automatically downloaded by Docker CE on Windows 10.

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.23.1, build b02f1306
docker-py version: 3.5.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018

Output of docker version

Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:47:51 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.24)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:56:41 2018
  OS/Arch:          windows/amd64
  Experimental:     false

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

networks:
  devtestnet:
    ipam:
      config:
      - subnet: 172.28.28.0/24
      driver: default
services:
  web:
    build:
      context: C:\SertifiKiln\__BuildAndRunInDocker\Volume\DevBuildWorkspace
      dockerfile: ../../Scripts/Compose/DevWebDockerfile
    container_name: c_devtest_com
    expose:
    - 80
    - 443
    image: devtest_com
    networks:
      devtestnet:
        aliases:
        - devtest.com
        - login.devtest.com
    volumes:
    - C:\testKiln\__SandboxQAReleases\latest\Web:C:/inetpub/Applications/dotNet2.0/testEsign/Program:ro
    - C:\SertifiKiln\__BuildAndRunInDocker\Volume\NAS:c:/NAS:rw
version: '3.7'

Steps to reproduce the issue

  1. docker-compose build

Observed result

Stack trace

Expected result

Build completes

Stacktrace / full error message

docker-compose build
Building web
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 287, in build
  File "compose\project.py", line 384, in build
  File "compose\project.py", line 366, in build_service
  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:\\SertifiKiln\\__BuildAndRunInDocker\\Volume\\DevBuildWorkspace\\../../Scripts/Compose/DevWebDockerfile'
[18796] Failed to execute script docker-compose

Additional information

OS version / distribution, docker-compose install method, etc.

Windows 10. Installed by going to https://store.docker.com/editions/community/docker-ce-desktop-windows , downloading the executable and installing.

Tried every combination of enclosing with single quotes, enclosing with double quotes, reversing the slashes, using \ on the ../../Scripts/Compose/DevWebDockerfile path.

@ZParanoya
Copy link
Author

ZParanoya commented Nov 20, 2018

Just checked. version 1.22.0 of docker-compose works fine. 1.23.1 and 1.23.0 do not work.

So it is an issue in latest version only. I downloaded https://github.com/docker/compose/releases/download/1.22.0/docker-compose-Windows-x86_64.exe , placed it into C:\Program Files\Docker\Docker\resources\bin and ran that instead. Build worked great

Output of different version commands

C:\SertifiKiln\__BuildAndRunInDocker\Volume\DevBuildWorkspace>docker version
Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:47:51 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.24)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:56:41 2018
  OS/Arch:          windows/amd64
  Experimental:     false

C:\SertifiKiln\__BuildAndRunInDocker\Volume\DevBuildWorkspace>docker-compose version
docker-compose version 1.22.0, build f46880fe
docker-py version: 3.4.1
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018

@shin-
Copy link

shin- commented Nov 21, 2018

Thanks for the report! We'll take a look asap.

@robertbird
Copy link

+1 having the same issue, reverting back to docker for windows 18.06.1-ce (with built in docker-compose version 1.22.0) seems to have fixed it.

@XedinUnknown
Copy link

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

@XedinUnknown
Copy link

Reverting manually to the executable at version 1.22.0 has the same results, except the paths displayed in the error do not have \\?\:

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 1052, in up
  File "compose\cli\main.py", line 1048, in up
  File "compose\project.py", line 471, in up
  File "compose\service.py", line 352, in ensure_image_exists
  File "compose\service.py", line 1067, in build
  File "site-packages\docker\api\build.py", line 154, 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: I:\projects\multilingualpress\vendor\bin\export-plural-rules
[17216] Failed to execute script docker-compose

@XedinUnknown
Copy link

Probably worth mentioning that I use docker-machine, and therefore I am not sure why it is using host OS paths instead of paths in the VM.

@archonic
Copy link

archonic commented Jun 11, 2020

I'm not sure why this was closed. I'm still seeing it in docker-compose 1.25.5, build 8a1c60f. It's also present in docker-compose 1.26.0-rc4, build d279b7a.

@XedinUnknown
Copy link

Gonna be a year soon

@maacpiash
Copy link

I'm also suffering from this one-and-a-half-year-old bug 😢

docker-compose version 1.25.5, build 8a1c60f6
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1c  28 May 2019

maacpiash added a commit to maacpiash/MqFind that referenced this issue Jul 1, 2020
For some unknown reason(s), Docker image can be built but the server app
cannot be accessed through the container.

For a known bug (docker/compose#6356), however, Docker Compose is not
working. The one-and-a-half-year-old bug is still not fixed ¯\_(ツ)_/¯
@Syntaf
Copy link

Syntaf commented Jul 24, 2020

For anyone running into this issue on a PHP stack, your vendor directory might be causing this bug if you're trying to send it along with the build context.

One possible solution is adding an additional volume mount so that vendor will never be mounted onto the host machine from the container.

services:
  app:
    build:
      context: ./myapp
      dockerfile: Dockerfile
    volumes:
      - /srv/example.com/myapp/vendor # <--- The path to your apps vendor directory

@mddarmawan
Copy link

Tl;dr
Remove vendor folder and run composer install. If you have Node packages, remove the node_modules, too and run npm install.

Source: #5888 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants