Executable file not found in $PATH (Alpine Linux)

Hi guys, sorry to bother u.
I’ve got this error when running docker exec, and unfortunately No idea how to fix it…

any good guy to help me?

//command:
sudo docker exec -it 90747a12f96a ls

answer:
OCI runtime exec failed: exec failed: unable to start container process: exec: “ls”: executable file not found in $PATH: unknown

I’ve tried with several commands, it not a matter of ls or accessing thru sh or ash or bash…

help me please :slight_smile: :pleading_face: :pray:

Hi :slight_smile:

The image you’re using is either hiding the commands, or not included.
Instead of trying to use “ls” directly, you can try the full path, like /usr/bin/ls, /bin/ls or /bin/sh

which image are you using ?

1 Like

I’m using portainer-ce:latest

And you are all right !!! when tried with other image, works perfect (louislam/uptime-kuma:1)…

So, how can I fix it for the portainer image from outside container, if can’t access thru terminal?

There is nothing to fix. There is just nothing in the container except portainer.

https://github.com/portainer/docker-images/blob/7859d9c0216f86bd7692efdc5cf675fa120fe3fa/base/Dockerfile#L5

https://github.com/portainer/portainer/blob/0eaf296e1b31bfca2e0a969a81aa62accd50ab90/build/linux/Dockerfile#L1C6-L1C20

1 Like

Absolutely crystal clear. Thx a los for the help. :slightly_smiling_face: