title: Invalid command \"/bin/sh\": file not found
body: <p>I have a Dockerfile with</p>
  
  <pre><code>CMD exec gunicorn --bind 8080 --workers 1 --threads 8 --timeout 0 app:app
  </code></pre>
  
  <p>which fails with error: <code>Invalid command \"/bin/sh\": file not found</code></p>
  
  <p>but the same command runs like this:</p>
  
  <pre><code>RUN gunicorn --bind 8080 --workers 1 --threads 8 --timeout 0 app:app
  </code></pre>
  
  <p>What could be wrong? </p>
  
  <p><strong>Update:</strong> The problem starts when I have these two lines added:
  <code>ENV APP_HOME /app</code> and <code>WORKDIR $APP_HOME</code></p>
  
  <p>Dockerfile:</p>
  
  <pre><code># Dockerfile
  FROM penguicky/docker-python3-opencv
  
  ENV APP_HOME /app
  WORKDIR $APP_HOME
  
  RUN apt-get update
  RUN apt-get install -y libsm6 libxext6 libxrender-dev
  RUN pip3 install Flask gunicorn
  RUN pip3 install opencv-contrib-python
  
  EXPOSE 8080
  
  #RUN echo $CV_VERSION
  
  COPY . ./
  
  CMD exec gunicorn --bind 8080 --workers 1 --threads 8 --timeout 0 app:app
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>I tried using this way: </p>
  
  <pre><code>CMD ["gunicorn", "--bind", "8080", "--workers", "1" ,"--threads", "8", "--timeout", "0" ,"app:app"]
  </code></pre>
  
  <p>now I get this: </p>
  
  <pre><code>2020-06-02 22:03:27.511 EEST[2020-06-02 19:03:27 +0000] [1] [INFO] Starting gunicorn 20.0.4
  2020-06-02 22:03:27.513 EEST[2020-06-02 19:03:27 +0000] [1] [ERROR] Invalid address: ('8080', 8000)
  </code></pre>
  
  <p><strong>Update2:</strong></p>
  
  <p>So it works by this:</p>
  
  <pre><code>CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "1" ,"--threads", "8", "--timeout", "0" ,"app:app"]
  </code></pre>
  
  <p>But I don't know the explanation why it works like this. </p>