Docker Community Forums

Share and learn in the Docker community.

Daemon: Container command '/bin/sh' not found or does not exist


(Ashokkumar) #1

Hi,

I had installed the docker version of 1.10.3 on windows 8

The fresh installation is everything okay.

But when i run the command “D:\projects\test-app>docker-compose up” inside my source folder.
*docker-compose is .yml file

In terminal it throws the error,

Step 5 : CMD python app.py
—> Running in a73883d8e9ab
—> 2b3159fece1e
Removing intermediate container a73883d8e9ab
Successfully built 2b3159fece1e
Creating testapp_web_1
←[31mERROR←[0m: Container command ‘/bin/sh’ not found or does not exist.

And when i ran the command “D:\projects\test-app>docker start testapp_web_1”, getting error
Error response from daemon: Container command ‘/bin/sh’ not found or does not exist.
Error: failed to start containers: testapp_web_1

Anyone have idea ? Anyone had faced the same issue before?

Updated Post:

below is my docker file,

FROM python:2.7
ADD . /code
WORKDIR /code/src
ADD /src/requirements.txt /code/
RUN pip install -r requirements.txt
CMD python app.py

My docker-compose.yml is,

version: '2'
services:
  web:
    build: .
    ports:
     - "5000:5000"
    volumes:
     - .:/code
    depends_on:
     - redis
  redis:
    image: redis

still i am getting error when running : $docker start "container-name"
Error response from daemon: Container command ‘/bin/sh’ not found or does not exist.

i had googling for almost a day, still no luck.


(Jeff Anderson) #2

It sounds like you have an image that doesn’t have /bin/sh installed, but your ENTRYPOINT or CMD is trying to call it.

What does the Dockerfile and entrypoint script look like?


(Isterjakov) #4

I have the same issue. Are you solve this?


(Ashokkumar) #5

Hi, still trying to rectify, but no luck.


(Ashokkumar) #6

HI, I had sort it out the issue,
Before running docker-compose up, we have to run the build command.
example,
$ docker build -t image1 .

and then

docker-compose up

now everything works perfectly.