SHELL
The Dockerfile instruction that changes which shell runs the shell form of later RUN, CMD and ENTRYPOINT instructions.
In more detail
The default on Linux is ["/bin/sh", "-c"]. A common use is SHELL ["/bin/bash", "-o", "pipefail", "-c"] so a failure in the middle of a pipe fails the build instead of being hidden.
Example
SHELL ["/bin/bash", "-o", "pipefail", "-c"]Related terms
- shell — The program that reads the commands you type, runs them and shows the results; sh and bash are common ones.
- exec form — Writing RUN, CMD or ENTRYPOINT as a JSON list such as ["python", "app.py"], so the program runs directly without a shell.
- RUN — The Dockerfile instruction that runs a command during the build and saves the result as a new layer.
Taught in
- RUN, SHELL And Efficient Layer Caching — Docker Architecture & Production Containers