title: docker-compose cannot start service: "exec: \"python3\": executable file not found
body: <p>(I'm not deeply experienced with <code>docker</code>, fwiw)</p>
  
  <p>I have a django appication I'm containerizing. Currently when I run 
  <code>docker-compose up</code> the <code>redis</code> service starts up, but <code>api</code>exits with error: <code>ERROR: for api  Cannot start service api: OCI runtime create failed: container_linux.go:296: starting container process caused "exec: \"python3\": executable file not found in $PATH": unknown</code></p>
  
  <pre><code>#docker-compose.yaml
  
  version: '3'
  services:
    redis:
        image: redis
        ports:
          - 6379
    api:
        build:
          context: ../backend/
          dockerfile: ../backend/Dockerfile
        env_file: .env
        volumes:
            - ../backend:/code/
        ports:
          - "8001:8001"
       depends_on:
          - redis
  </code></pre>
  
  <p>with</p>
  
  <pre><code>#../backend/Dockerfile
  FROM python:3
  ENV PYTHONUNBUFFERED 1
  RUN mkdir /code
  ADD . /code/
  WORKDIR /code/
  RUN pip install -r requirements.txt
  CMD python manage.py runserver
  </code></pre>
  
  <p>and</p>
  
  <pre><code>#./.env 
  
  DJANGO_SETTINGS_MODULE=backend.settings.dev
  DJANGO_SECRET_KEY=&lt;redacted&gt;
  SENTRY_URL=&lt;redacted&gt;
  </code></pre>
  
  <p>I've also, based on other issues, tried using both <code>CMD</code> and <code>RUN</code> with their differing argument types, i.e. in the existing shell and without, but the output hasn't changed. </p>
  
  <p>I should also acknowledge that it's possible I'm not restarting actually catching the updates to <code>docker-compose.yaml</code> or <code>Dockerfile</code>. My workflow has been <code>$ docker-compose down</code> followed by <code>$ docker-compose up</code>.</p>
  
  <p>EDITS:</p>
  
  <p>@henrik-andersson pointed me in the right direction. The proximate cause of the error is the fact that the image itself was not built, so the executable <code>python</code> didn't exist. the command I needed to run was <code>docker-compose up --build</code></p>