compose: System error: no such file or directory on Windows

Trying to run docker-compose up, my first container with a bind mount seems to be failing:

compose.cli.main.main: Cannot start container b097f0e6f952c1b40fd25f98f64ec27babe9efbfeabf224be939f07c87a9cd35: [8] System error: no such file or directory

Here’s the relevant portion of my docker-compose.yaml:

search:

  container_name: dev_search
  image: elasticsearch

  volumes:
    - ./elasticsearch/docker-entrypoint.sh:/docker-entrypoint.sh
    - ./elasticsearch/config:/usr/share/elasticsearch/config
    - ./elasticsearch/data:/usr/share/elasticsearch/data

  ports:
    - "9200:9200"
    - "9300:9300"

Docker Compose version:

$ docker-compose --version
docker-compose version: 1.5.0rc3

Docker version:

$ docker --version
Docker version 1.8.3, build f4bf5c7

Docker Machine version:

$ docker-machine --version
C:\Program Files\Docker Toolbox\docker-machine.exe version 0.4.1 (e2c88d6)

Other fun facts:

  • Windows 10
  • Project runs fine on OSX and Linux
  • docker-machine ssh default and it looks like all the vboxsf mounts are good
  • Containers seem to be building fine, phewf!
  • cc. #1085
  • cc. #2158
  • cc. #2128
  • Apologies if it seems like this is a duplicate, I haven’t seen any momentum on getting this resolved and hopefully I’m not being dramatic when I say: This is quite a blocker and I’d love to be able to continue helping with testing my real project on Windows.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22

Commits related to this issue

Most upvoted comments

Ok, the bind mounts look correct.

I looked around for tickets with similar errors, and I’m pretty sure the issue is with the entrypoint script /docker-entrypoint.sh. The script needs to have executable permission (chmod +x).

I’m not sure how that works in windows. I don’t think there is an equivalent. So I think you’ll have to change your config to include:

entrypoint: ['bash', '/docker-entrypoint.sh']

That way the script isn’t being run directly, it’ll run using bash, which has the executable permission enabled on it already.

Sets git to clone repos without adjusting line-endings for unix to windows

For anyone coming across this issue. This was one of the first places I checked for a solution for this as I was experiencing the same problem when running Docker CE for windows. After some extensive research and multiple attempts, I came across this, which is the only fix that has worked for me so far. It may not resolve your issues, but it is something to try first at least.


Windows ends lines in a carriage return and a linefeed \r\n, While Linux and macOS only use a linefeed \n.

In cmd enter: git config --global core.autocrlf input

Found at https://github.com/docker/toolbox/issues/126

I had a similar issue with Windows 10 and changing the following in my Dockerfile worked for me:

CMD ["/run.sh"] to ENTRYPOINT ["/bin/bash", "/run.sh"]