question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker-compose fails at long paths on windows

See original GitHub issue

When running docker-compose build in a project that contains long paths (the path below is exactly 260 chars, the maximum allowed in windows), building fails.

It is related to https://github.com/docker/compose/issues/2473 but it seems the solution lies in this repository, since the stack trace matches with these source files.

Let me know if it should be fixed in another repo.

Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 62, in main
  File "compose\cli\main.py", line 114, in perform_command
  File "compose\cli\main.py", line 835, in up
  File "compose\project.py", line 382, in up
  File "compose\service.py", line 305, in ensure_image_exists
  File "compose\service.py", line 727, in build
  File "site-packages\docker\api\build.py", line 55, in build
  File "site-packages\docker\utils\utils.py", line 95, in tar
  File "tarfile.py", line 2007, in add
  File "tarfile.py", line 1879, in gettarinfo
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\Users\\johnd\\dev\\tmp\\foobar\\node_modules\\gulp-clean\\node_modules\\gulp-util\\node_modules\\dateformat\\node_modules\\meow\\node_modules\\normalize-package-data\\node_modules\\validate-npm-package-license\\node_modules\\spdx-correct\\node_modules\\spdx-license-ids\\LICENSE'
docker-compose returned -1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14

github_iconTop GitHub Comments

6reactions
BrunoZellcommented, Jul 31, 2018

adding node_modules to your .dockerignore can solve this issue too possibly

4reactions
sanchitbhcommented, Oct 7, 2017

Trying to run docker-compose and I keep getting this error:

c:\tmp>docker-compose up
Building web
Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 68, in main
  File "compose\cli\main.py", line 121, in perform_command
  File "compose\cli\main.py", line 938, in up
  File "compose\project.py", line 430, in up
  File "compose\service.py", line 317, in ensure_image_exists
  File "compose\service.py", line 918, in build
  File "site-packages\docker\api\build.py", line 148, in build
  File "site-packages\docker\utils\build.py", line 14, in tar
  File "site-packages\docker\utils\utils.py", line 100, in create_archive
  File "tarfile.py", line 1881, in gettarinfo
WindowsError: [Error 3] The system cannot find the path specified: u'c:\\tmp\\var\\node_modules\\axiom\\node_modules\\npm\\node_modules\\pacote\\node_modules\\make-fetch-happen\\node_modules\\http-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise\\all.js'
Failed to execute script docker-compose

Versions:

c:\tmp>docker -v
Docker version 17.09.0-ce, build afdb6d4

c:\tmp>docker-compose -v
docker-compose version 1.16.1, build 6d1ac219

I guess this is because of MAX_PATH limit on Windows for which I’ve tried enabling the Enable Win32 long paths but I still keeping getting this error.

Any ideas on how I can fix this? In the meantime is there an option to tell docker-compose to ignore this file and run the rest of it anyway?

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker-compose cannot locate the specified Dockerfile
I found it here: docker-compose gives ERROR: Cannot locate specified Dockerfile: Dockerfile. Instead of folder/Dockerfile
Read more >
docker-compose using incorrect path - Visual Studio Feedback
Your open channel to Microsoft engineering teams ... I get the following error from docker-compose "build path f:\program files (x86)\Microsoft Visual ...
Read more >
Compose file build reference - Docker Documentation
Context path can be absolute or relative, and if so relative path MUST be resolved from Compose file parent folder. As an absolute...
Read more >
Windows Container Version Compatibility | Microsoft Learn
docker : Error response from daemon: container ... As of April 16, 2019, the "latest" tag is no longer published or maintained for...
Read more >
Docker compose volume syntax valid for Windows and Linux
Yes. Just use ./ for you current directory that the Docker-compose file is in. Your "working directory" for the compose file is just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found