Docker-py: Doesn't work with special chars in path

Created on 23 Jan 2016  ·  12Comments  ·  Source: docker/docker-py

Not working:

Správca@gadelat-pc MINGW64 ~/Documents/feed/docker2 (stats)
$ pwd
/c/Users/Správca/Documents/feed/docker2

Správca@gadelat-pc MINGW64 ~/Documents/feed/docker2 (stats)
$ docker-compose build
Building adminer
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "C:\projects\compose\compose\cli\main.py", line 54, in main
  File "C:\projects\compose\compose\cli\docopt_command.py", line 23, in sys_disp     atch
  File "C:\projects\compose\compose\cli\docopt_command.py", line 26, in dispatch
  File "C:\projects\compose\compose\cli\main.py", line 171, in perform_command
  File "C:\projects\compose\compose\cli\main.py", line 192, in build
  File "C:\projects\compose\compose\project.py", line 235, in build
  File "C:\projects\compose\compose\service.py", line 683, in build
  File "c:\projects\compose\venv\lib\site-packages\docker\api\build.py", line 41     , in build
TypeError: You must specify a directory to build in path
docker-compose returned -1

After copying, this issue no longer exists (another problem occured, but that's another issue I guess):

Správca@gadelat-pc MINGW64 /c/Downloads/feed/docker2 (stats)
$ pwd
/c/Downloads/feed/docker2

Správca@gadelat-pc MINGW64 /c/Downloads/feed/docker2 (stats)
$ docker-compose build
Building adminer
Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
grouwindows kinbug

All 12 comments

What are the contents of your compose file? Specifically for the adminer service?

adminer:
    build: images/adminer
    restart: always
    ports:
        - "8012:80"

images/adminer:

FROM clue/adminer

I'm not able to reproduce the issue:

aやよい$ docker-compose build
Building adminer
Step 1 : FROM clue/adminer
 ---> ea11c9f031e5
Successfully built ea11c9f031e5

Do you still encounter the same issue with docker-compose 1.6.0?

Your output isn't from windows terminal as mine is. Also, you didn't show output of pwd. In my output it's clear that my home directory is with diacritic. In yours, it's not clear if that's home. I don't think so.

I have access to windows pc like... once a month.

After hours of tests I have finally found this thread which looks to be exactly my problem :

Raphaël@X1YOGA MINGW64 ~/Projets/docker/lamp
$ docker-compose up
Building lamp
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 56, in main
  File "compose\cli\docopt_command.py", line 23, in sys_dispatch
  File "compose\cli\docopt_command.py", line 26, in dispatch
  File "compose\cli\main.py", line 191, in perform_command
  File "compose\cli\main.py", line 657, in up
  File "compose\project.py", line 318, in up
  File "compose\service.py", line 351, in execute_convergence_plan
  File "compose\service.py", line 252, in create_container
  File "compose\service.py", line 275, in ensure_image_exists
  File "compose\service.py", line 679, in build
  File "site-packages\docker\api\build.py", line 42, in build
TypeError: You must specify a directory to build in path
docker-compose returned -1

Raphaël@X1YOGA MINGW64 ~/Projets/docker/lamp
$ pwd
/c/Users/Raphaël/Projets/docker/lamp

Raphaël@X1YOGA MINGW64 ~/Projets/docker/lamp
$ docker-compose -v
docker-compose version 1.6.2, build e80fc83

I changed my account folder to C:\Raphael and it works.

Should be fixed in recent versions.

It isn't.

C:\Users\Šarlatán                                                                    
λ docker-compose build                                                               
Building adminer                                                                     
ERROR: Windows named pipe error: The system cannot find the file specified. (code: 2)

C:\Users\Šarlatán                                                                    
λ docker-compose --version                                                           
docker-compose version 1.23.0, build c8524dc1                                        

C:\Users\Šarlatán                                                                    
λ                                                                                    

Reopen please, thx.

Hmm, I've tried to reproduce on Windows with the same user name, but this still works fine for me:

PS C:\Users\Šarlatán\Documents\feed\docker2> docker-compose version
docker-compose version 1.23.1, build b02f130
docker-py version: 3.5.1
CPython version: 3.7.1
OpenSSL version: OpenSSL 1.1.0i  14 Aug 2018
PS C:\Users\Šarlatán\Documents\feed\docker2> docker-compose build
Building adminer
Step 1/1 : FROM docker4w/nsenter-dockerd
 ---> cae870735e91
Successfully built cae870735e91
Successfully tagged docker2_adminer:latest

With Compose file:

version: '2'
services:
  adminer:
    build: images/adminer
    ports:
      - 8012:80
    restart: always

I have a few questions if we want to figure this out:

  • Please post the full output of the docker-compose version command
  • What terminal program are you using? Is it git-bash, Cygwin, something else?

    • Does it change anything if you run Compose from Powershell instead?

  • What version of Windows are you running on?
  • How did you install Docker? (docker-machine or Toolbox, Docker Desktop for Windows, other?)
  • How did you install docker-compose?

    • If installed through pip, what version of Python are you running on?

    • If installed through pip, does the binary package exhibit the same issue?

C:\Users\Šarlatán>docker-compose version
docker-compose version 1.23.0, build c8524dc1
docker-py version: 3.5.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018

C:\Users\Šarlatán>docker-compose build
ERROR: Windows named pipe error: The system cannot find the file specified. (code: 2)

terminal program
Does it change anything if you run Compose from Powershell instead

Reproducible in any. Tried cmd.exe, powershell, ConEmu

version of Windows

Last one I tried this is Windows 10 64bit, version 1803, build 17134.345, running in Virtualbox VM. I know docker won't work there, this is only to confirm this issue has been fixed.

How did you install Docker, docker-compose?

I use chocolatey, install via choco install docker-compose

does the binary package exhibit the same issue?

yep

C:\Users\Šarlatán>docker-compose-Windows-x86_64.exe build
ERROR: Windows named pipe error: The system cannot find the file specified. (code: 2)

Last one I tried this is Windows 10 64bit, version 1803, build 17134.345, running in Virtualbox VM. I know docker won't work there, this is only to confirm this issue has been fixed.

Oh, if Docker isn't running, then the error you're seeing is normal and expected (it's not a great error message but we're getting that fixed soon)

All in all, I'm pretty confident it's been fixed, but please confirm on a machine running Docker so I can close this!

Ah ok that makes sense. I'm not going to have access to windows machine for a while so I think we can close it until someone here will report this again.

What might have been the issue anyway that that you are confident this is fixed?

Was this page helpful?
0 / 5 - 0 ratings