6

I am not able to run the container from the image in docker for windows version 18.03.1-ce. I am trying to run the command:

  docker run ubuntu -it /bin/bash

Somehow it is not able to find the path of the /bin/bash. I don't know why this is happening.

b0gusb
  • 4,283
  • 2
  • 14
  • 33
Amit Kumar Jain
  • 487
  • 2
  • 11
  • 25

3 Answers3

25

The docker command line is order sensitive. The order of args goes:

docker ${args_to_docker} run ${args_to_run} image_ref ${cmd_in_container}

Everything after ubuntu in your command goes to the command trying to be run. In your case -it. What you want instead is to pass -it to "run" so that you get interactive input with a tty terminal associated.

docker run -it ubuntu /bin/bash
BMitch
  • 231,797
  • 42
  • 475
  • 450
-1

This error encountered when trying to run command that is not in docker container /usr/bin or /usr/local/bin. If you have let's say rar installed in the docker then you can run rar command via docker exec, if you don't, will get the error above.

Also don't use -t only use -i like below:

docker exec -i <container_name> <command>
docker exec -i <container_name> rar
Vaseem007
  • 2,401
  • 22
  • 20
-2

Before trying anything, check your docker version, update, and try again.

Pang
  • 9,564
  • 146
  • 81
  • 122
sonia kaushal
  • 495
  • 6
  • 5