November 2018
Beginner
230 pages
6h 4m
English
As you have read in many sections throughout this chapter, there are several instructions that take two forms, the exec form or the shell form. As mentioned, the default used by all of the shell forms is ["/bin/sh", "-c"] for Linux containers, and ["cmd", "/S", "/C"] for Windows containers. The SHELL instruction allows you to change that default. Here is the syntax for the SHELL instruction:
# SHELL instruction syntaxSHELL ["executable", "parameters"]
The SHELL instruction can be used more than once in a Dockerfile. All instructions that use a shell, and that come after a SHELL instruction, will use the new shell. Thus, you can change the shell multiple times in a single Dockerfile as needed. This can be especially powerful ...
Read now
Unlock full access