Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error response from daemon: oci runtime error: container_linux.go:262 :

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.

like image 295
Kalyan Avatar asked Jul 24 '17 07:07

Kalyan


1 Answers

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.

like image 83
ovo Avatar answered Oct 20 '22 06:10

ovo