0

I cant connect to my running container with portainer. I tried already executing docker exec -it <CONTAINER-ID> /bin/bash. Also changed the shell path many times (/bin/sh, /usr/bin/sh, bash). Every time I get message:

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: "/bin/bash": stat /bin/bash: no such file or directory": unknown

Container was created with command:

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Can you tell me why I can't connect to this container only? Portainer web interface is working fine... I thought each container had access to shell, and basic tools such as ls

1
  • 1
    If the container does not include /bin/bash then you can not start it with docker exec – Jonas Jan 10 at 19:51
1

Containers may or may not include a shell, depending on how the container was built. Looking at docker hub it looks like the base image may be based on a "scratch" image, meaning that there may not be anything in the container other than the code needed to run the portainer service. The image layers here also suggest this is the case.

If you want a shell, you may want to use the portainer/portainer-ca:alpine tag. That should give you a container with a full alpine os (and the shell you are looking for). As another note, you may want to try using /bin/sh instead as not all images provide a bash shell.

0

I thought each container had access to shell, and basic tools such as ls

Only containers that have included a shell has support for a shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.