I'm trying to connect to a running container or start a new container in interactive mode with the bash shell -- not the sh shell. I want to run:
docker exec -it <container_name> /bin/bash
or
docker run -it <container_name> <image_name>
or
docker run -it <container_name> <image_name> /bin/bash
and get an interactive bash shell.
What I've tried so far:
Per this post I've tried
Adding this to my Dockerfile
SHELL ["/bin/bash", "-c"]
Adding this to my Dockerfile
RUN ["/bin/bash", "-c", "echo I am now using bash!"]
But every time I try to run a container in interactive mode (docker run -it or attach to a running container (docker exec -it), I land in the sh shell.
How can I get an interactive bash shell that is running inside a docker container?
Update: Minimal working Dockerfile
FROM ubuntu
SHELL ["/bin/bash", "-c"]
FROM, or if you're taking explicit steps to install bash where appropriate, we can't say if yours does or not.RUN ["/bin/bash", "-c", "echo \"$BASH_VERSION\""]? You say you tried the relevantRUN, but you don't tell us what happened.sh?echo $BASH_VERSIONoutputs in the shell you think issh?