4

I am trying to run an image that I pulled from a system I inherited, and I am getting this cryptic error message.

docker run bc189eaeb16d /bin/bash docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown. ERRO[0001] error waiting for container: context canceled 

What exactly is going on? Do I need to mount some volume? I've googled this error message but nothing seems relevant

6
  • Why do you call the error "cryptic"? It clearly states that there is no /bin/bash binary inside the image. If you are sure that it is - add more details (Dockerfile, etc.). Commented Jul 19, 2019 at 4:07
  • The only Dockerfile I have (I inherited this) says this: FROM jboss/keycloak-ha-postgres # COPY /themes /opt/jboss/keycloak/themes/ # COPY /deployments /opt/jboss/keycloak/standalone/deployments/ COPY ./standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/ Commented Jul 19, 2019 at 5:07
  • The last command on a similar container I am trying to replicate is: /opt/jboss/docker-entrypoint.sh -b 0.0.0.0 --server-config standalone-ha.xml Commented Jul 19, 2019 at 5:08
  • Are you sure bc189eaeb16d is based from jboss/keycloak-ha-postgres? The error used jboss/keycloak-ha-postgres to run a container totally different with what you post. Please share a correct dockerfile, if not have, also please tag your local image & push to dockerhub for folks to check. Or you may omit something in the post which maybe you think not important but in fact really related to the root cause. Commented Jul 19, 2019 at 5:56
  • 1
    Many images based on Alpine Linux don't have GNU Bash. Most images have some sort of POSIX-compliant /bin/sh though. Commented Jul 19, 2019 at 11:56

2 Answers 2

4

You are trying to override jboss/keycloak-ha-postgres image's default entrypoint. I tried the following command

docker run -it jboss/keycloak-ha-postgres /bin/bash 

but I got a different error than yours, but this error makes things clearer. The error is:

WFLYSRV0073: Invalid option '/bin/bash' Usage: standalone.sh [args...] where args include: A list of supported arguments 

which means that the custom entrypoint that you think it will be executed is supplied as additional argument to jboss's standalone.sh script.

Try with this command to override default image's entrypoint:

docker run -it --entrypoint "/bin/sh" jboss/keycloak-ha-postgres 

Docs

Sign up to request clarification or add additional context in comments.

10 Comments

I think we're closer - but I am getting this message: docker run -it --entrypoint "/bin/sh" bc189eaeb16d docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown.
What is bc189eaeb16d? Image hash or container hash? What is your host's OS? Windows? If yes ensure that all files copied to the container have LF endings.
Image hash. I saved an image so I would think it would save the context but it appears not to. I am running this on MacOS.
If you execute another command does it work? Try docker run -it --entrypoint "pwd" bc189eaeb16d .
It does not. docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"pwd\": executable file not found in $PATH": unknown. - maybe a corrupted image?
|
1

It seems that your docker image doesn't include the bash shell.

  • If you have access to the Dockerfile you can see from which parent image this one extends
  • If you don't have access to the Dockerfile and want to get more information you can use the inspect command to get more information about this image. docker inspect bc189eaeb16d
  • You can also try docker run bc189eaeb16d /bin/sh or docker run bc189eaeb16d sh and see if that works.

Update: Based on your feedback it seems that your image extends from the image named jboss/keycloak-ha-postgres.

If you follow the extension path of the docker files you will notice that it takes you all the way down to the centos:7 image which has the bash shell.

jboss/keycloak-ha-postgres > jboss/keycloak-postgres > jboss/base-jdk:8 > jboss/base:latest > centos:7

My suggestion is to follow the instructions provided in the usage section of the jboss/keycloak-ha-postgress site and once the containers are running try attaching to them.

1 Comment

Same error with /bin/sh. Dockerfile is literally just copying something: COPY ./standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.