Skip to main content
Use SHELL to change the default shell.

Description

Docker provides a SHELL instruction which does not require overwriting /bin/sh in your container. Instead of using ln -sf to redirect /bin/sh, use the SHELL instruction to set the desired shell.

Examples

Problematic code

Correct code

Auto-fix

Replaces ln -sf targeting /bin/sh with a SHELL instruction. If the ln command is part of a larger RUN, the ln portion is removed and a SHELL instruction is inserted after.

Reference