Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default /bin/sh to /bin/bash on opening CLI for selected container in Docker Desktop?

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?

like image 551
Hubert Jakubiak Avatar asked Sep 04 '25 01:09

Hubert Jakubiak


2 Answers

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

like image 185
Vijayaraghavan Sundararaman Avatar answered Sep 06 '25 18:09

Vijayaraghavan Sundararaman


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.

like image 23
Djoles Avatar answered Sep 06 '25 17:09

Djoles