SHELL
to change the default shell DOK-DL4005Docker provides a SHELL
instruction allowing for changing the default shell for all subsequent RUN
commands.
Manually changing shell is inefficient for two reasons.
First, there is an un-necessary root shell processor invocation.
Second, each RUN
instruction in the shell form requires an extra shell command(/bin/sh -c
) prefix.
# Install bash
RUN apk add --update-cache bash=4.3.42-r3
# Use bash as the default shell
RUN ln -sfv /bin/bash /bin/sh
# Install bash
RUN apk add --update-cache bash=4.3.42-r3
# Use bash as the default shell
SHELL ["/bin/bash", "-c"]