docker-compose run returns /bin/ls cannot execute binary file
docker
Solution
The `entrypoint` to your container is `bash`. By default bash expects a shell script as its first argument, but `/bin/ls` is a binary, as the error says. If you want to run `/bin/ls` you need to use `-c /bin/ls` as your command. `-c` tells bash that the rest of the arguments are a command line rather than the path of a script, and the command line happens to be a request to run `/bin/ls`.
Problem
I have just started learning Docker, and run into this issue which don't know how to go abound. My Dockerfile looks like this: ``` FROM node:7.0.0 WORKDIR /app COPY app /app COPY hermes-entry /usr/local/bin RUN chmod +x /usr/local/bin/hermes-entry COPY entry.d /entry.d RUN npm install RUN npm install -g gulp RUN npm install gulp RUN gulp ``` My docker-compose.yml looks like this: ``` version: '2' services: hermes: build: . container_name: hermes volumes: - ./app:/app ports: - "4000:4000" entrypoint: /bin/bash links: - postgres depends_on: - postgres tty: true postgres: image: postgres container_name: postgres volumes: - ~/.docker-volumes/hermes/postgresql/data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: password ports: - "2345:5432" ``` After starting the containers up with: ``` docker-compose up -d ``` I tried running a simple bash cmd: ``` docker-compose run hermes ls ``` And I got this error: ``` /bin/ls cannot execute binary file ``` Any idea on what I am doing wrong?