Skip to content
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

Add note for Debian family(such as Ubuntu) #30968

Closed
wants to merge 1 commit into from
Closed

Add note for Debian family(such as Ubuntu) #30968

wants to merge 1 commit into from

Conversation

eromoe
Copy link

@eromoe eromoe commented Feb 13, 2017

There are many requests that demand using /bin/bash instead of /bin/sh

#8100
#7489
#7281

It because they are using the image of Debian family. It is inconvenient to write all command like RUN ["/bin/bash", "-c", "python test.py"].
And here is a much more simple way:

FROM some-image
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

I think this is a very useful note should be include in docs.

There are many requests that demand using `/bin/bash` instead of `/bin/sh`

#8100
#7489
#7281

It because they are using the image of Debian family. It is inconvenient to write all command like `RUN ["/bin/bash", "-c", "python test.py"]`. 
And here is a much more simple way:

```
FROM some-image
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
```
@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "patch-1" git@github.com:eromoe/docker.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@GordonTheTurtle GordonTheTurtle added dco/no Automatically set by a bot when one of the commits lacks proper signature status/0-triage labels Feb 13, 2017
@AkihiroSuda
Copy link
Member

I'm -1 on this change.
Users should be able to use SHELL instead.
https://docs.docker.com/engine/reference/builder/#/shell

@ijc
Copy link
Contributor

ijc commented Feb 13, 2017

Apart from the suggestion to use SHELL (which I agree with) the better/supported way to change the default /bin/sh link in Debian from dash to bash would be something like:

RUN echo "dash dash/sh boolean false" | debconf-set-selections - && dpkg-reconfigure dash

and to switch back:

RUN echo "dash dash/sh boolean true" | debconf-set-selections - && dpkg-reconfigure dash

(only tried this from the shell prompt not actually in a Dockerfile so caveat emptor)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs dco/no Automatically set by a bot when one of the commits lacks proper signature status/3-docs-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants