If I select any container and click CLI button, the /bin/sh shell will be opened by default. Is there any way to manually reconfigure Docker to open /bin/bash?
If I select any container and click CLI button, the /bin/sh shell will be opened by default. Is there any way to manually reconfigure Docker to open /bin/bash?
Not exactly answer you asked for but for me it works to type bash in sh terminal. It opens bash over the sh. Only nousance is that I must exit twice.
It will depend on the base image, you can build a custom image and add bash if it is not available. And link the create a link to use bash instead of sh
FROM <BASE_IMAGE>
RUN apk add --no-cache bash
RUN ln -sf /bin/bash /bin/sh
I changed default shell into bash by making a new image with below Dockerfile commands.
# Dockerfile
FROM <parent image>
# make /bin/sh symlink to bash instead of dash:
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# set ENV to execute startup scripts
ENV ENV ~/.profile
and create a new image.
$ docker build --tag <image> .
change symbolic link of /bin/sh to bash
https://superuser.com/questions/715722/how-to-do-dpkg-reconfigure-dash-as-bash-automatically
source ~/.profile file when executing /bin/sh
If you want to clear ENV after startup, you may add below line to the ~/.bashrc file. (Be careful not to mess up other scripts)
unset ENV