-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make builder RUN use /bin/bash instead of /bin/sh #7281
Comments
No, this hardcoded to "/bin/sh -c" |
I ended up changing my Dockerfile script to copy a file and use that rather than use the redirection I had been using in bash. |
@dwatrous did you try |
bash can be used manually by using it in There's no intention or plan to make it possible to change it to bash. I'll mark this as a doc issue because we might want to document this. It's the third or fourth time this question has popped up. |
PR: #7489 |
This can be closed now due to: #7489 |
so what's the story on this one? |
@ORESoftware See the discussion above, and #22489, which added the
|
I know I am late to the party and yes this isn't the best solution, but it worked for what I needed In my docker file after downloading and extracting the SDK I run these two commands RUN cp /bin/bash /bin/sh After that the gcloud command is available during the build and at run time |
For those interested in strict OCI reproducibility, the Dockerfile call
Update: Looks like thaJeztah is correct, some discussion regarding supporting this feature over at buildah: containers/buildah#507 Update2: |
@qhaas don't think that has to do with OCI specifications, just the buildah implementation |
…er shell See: [docs](https://docs.docker.com/engine/reference/builder/#shell) and [related GitHub issue](moby/moby#7281)
RUN chsh -s /bin/bash |
I know this is pretty old, but this worked for me to change the default shell to Bash both within SHELL [ "/bin/bash", "-c" ]
ENV SHELL=/bin/bash |
By doing this, you only change the variable name. If you run |
@Sciencoded , I tried this, but it gives me error for this part in my dockerfile:
mv in this form doesnt work. |
What @tiborvass suggest is great, but in case you need a brust force using something like:
|
this works for me, thanks |
I'm creating a Dockerfile build script and would like to use bash commands. RUN uses /bin/sh by default. Is there some way to tell RUN to use /bin/bash instead?
The text was updated successfully, but these errors were encountered: