I have just started to use docker. I have installed alpine
image for testing docker workflow but after running
docker run alpine ls -l
I am getting this following error
Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "exec: \"ls-l\": executable file not found in $PATH".
I have installed Docker Desktop for Windows in Windows 10.
The last argument to docker run
must be the name of an executable. ls
is a command implemented by the shell, but not an executable in itself, hence the error you see. You have to tell docker to run ls
in the context of a particular shell. E.g.
$ docker run alpine sh -c 'ls -l'
total 52
drwxr-xr-x 2 root root 4096 Oct 25 22:05 bin
drwxr-xr-x 5 root root 340 Nov 15 22:45 dev
drwxr-xr-x 14 root root 4096 Nov 15 22:45 etc
...
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With