0

Can anyone could give me a clue why I am not able run a command in ENTRYPOINT. My Docker file looks like

.....
.....  
ENTRYPOINT ["bash -c tox -e docker-server"]

But when I do Dcoker run, I get this error

Docker: Error response from daemon: OCI runtime create failed: 
container_linux.go:348: starting container process caused "exec: \"bash -c 
tox -e docker-server\": executable file not found in $PATH": unknown.

Then I changed the command to ENTRYPOINT ["sh ls -l"], this time too I got any error

Docker: Error response from daemon: OCI runtime create failed: 
container_linux.go:348: starting container process caused "exec: \"sh ls - 
l\": executable file not found in $PATH": unknown.
Fact
  • 1,957
  • 1
  • 17
  • 26

1 Answers1

2

You need to specify each word in your command line in a separate element in the ENTRYPOINT array, such as:

ENTRYPOINT ["bash", "-c", "tox", "-e", "docker-server"]

Otherwise, docker will try to find an executable called "bash -c tox -e docker-server" and of course that doesn't exist.

whites11
  • 12,008
  • 3
  • 36
  • 53