title: docker-compose "No such file or directory" for sh-command
body: <p>I am setting up <code>docker-for-windows</code> on my private pc.</p>
  
  <p>When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.</p>
  
  <p>So I am stuck with this:</p>
  
  <p>I have a docker-working project (on my other computer) with a <code>docker-compose.yml</code> like this:</p>
  
  <pre><code>version: '2'
  
  services:
    web:
      depends_on:
        - db
      build: .
      env_file: ./docker-compose.env
      command: bash ./run_web_local.sh
      volumes:
        - .:/srv/project
      ports:
        - 8001:8001
      links:
        - db
        - rabbit
      restart: always
  </code></pre>
  
  <p><strong>Dockerfile:</strong></p>
  
  <pre><code>### STAGE 1: Build ###
  
  # We label our stage as 'builder'
  FROM node:8-alpine as builder
  
  RUN npm set progress=false &amp;&amp; npm config set depth 0 &amp;&amp; npm cache clean --force
  
  # build backend
  ADD package.json /tmp/package.json
  ADD package-lock.json /tmp/package-lock.json
  RUN cd /tmp &amp;&amp; npm install
  RUN mkdir -p /backend-app &amp;&amp; cp -a /tmp/node_modules /backend-app
  
  ### STAGE 2: Setup ###
  FROM python:3
  
  # Install Python dependencies
  COPY requirements.txt /tmp/requirements.txt
  RUN pip3 install -U pip
  RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
  
  # Set env variables used in this Dockerfile (add a unique prefix, such as DOCKYARD)
  # Local directory with project source
  ENV PROJECT_SRC=.
  # Directory in container for all project files
  ENV PROJECT_SRVHOME=/srv
  # Directory in container for project source files
  ENV PROJECT_SRVPROJ=/srv/project
  
  # Create application subdirectories
  WORKDIR $PROJECT_SRVPROJ
  RUN mkdir media static staticfiles logs
  
  # make folders available for other containers
  VOLUME ["$PROJECT_SRVHOME/media/", "$PROJECT_SRVHOME/logs/"]
  
  # Copy application source code to SRCDIR
  COPY $PROJECT_SRC $PROJECT_SRVPROJ
  
  COPY --from=builder /backend-app/node_modules $PROJECT_SRVPROJ/node_modules
  
  # Copy entrypoint script into the image
  WORKDIR $PROJECT_SRVPROJ
  
  # EXPOSE port 8000 to allow communication to/from server
  EXPOSE 8000
  
  CMD ["./run_web.sh"]
  </code></pre>
  
  <p><strong>docker-compose.env:</strong></p>
  
  <pre><code>C_FORCE_ROOT=True
  DJANGO_CELERY_BROKER_URL=amqp://admin:mypass@rabbit:5672//
  DJANGO_DATABASE_ENGINE=django.db.backends.mysql
  DJANGO_DATABASE_NAME=project-db
  DJANGO_DATABASE_USER=project-user
  DJANGO_DATABASE_PASSWORD=mypassword
  DJANGO_DATABASE_HOST=db
  DJANGO_ALLOWED_HOSTS=127.0.0.1,localhost
  DJANGO_DEBUG=True
  DJANGO_USE_DEBUG_TOOLBAR=off
  DJANGO_TEST_RUN=off
  PYTHONUNBUFFERED=0
  </code></pre>
  
  <p><strong>run_web_local.sh:</strong></p>
  
  <pre><code>#!/bin/bash
  echo django shell commands
  python ./manage.py migrate
  echo Starting django server on 127.0.0.1:8000
  python ./manage.py runserver 127.0.0.1:8000
  </code></pre>
  
  <p>When I call <code>docker-compose up web</code> I get the following error:</p>
  
  <blockquote>
    <p>web_1          | bash: ./run_web_local.sh: No such file or directory</p>
  </blockquote>
  
  <ul>
  <li>I checked the line endings, they are UNIX</li>
  <li>the file exists on the file system as well as inside the container</li>
  <li>I can call <code>bash run_web_local.sh</code> from my windows powershell and inside the container</li>
  <li>I changed the UNIX permissions inside the container</li>
  <li>I left out the <code>bash</code> in the <code>command</code> in the <code>docker-compose</code> command. And tried with backslash, no dot etc.</li>
  <li>I reinstalled docker</li>
  <li>I tried switching to version 3</li>
  <li>docker claims to have a connection to my shared drive C</li>
  </ul>
  
  <p>And: The exact same setup <strong>works</strong> on my other laptop.</p>
  
  <p>Any ideas? All the two million github posts didn't solve the problem for me.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Update</strong></p>
  
  <p>Removing <code>volumes:</code> from the docker-compose makes it work <a href="https://github.com/docker/compose/issues/2548" rel="noreferrer">like stated here</a> but I don't have an instant mapping. That's kind of important for me...</p>