This product is not supported for your selected Datadog site. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:docker-best-practices/change-default-shell
Language: Docker
Severity: Warning
Category: Best Practices
Description
This rule encourages the use of the SHELL instruction to explicitly change the default shell in a Dockerfile rather than modifying it indirectly through commands like RUN ln -sfv /bin/bash /bin/sh. Using SHELL provides a clear and declarative way to specify which shell should be used for subsequent instructions, improving readability and maintainability.
To comply with this rule, replace any commands that attempt to change the default shell indirectly, such as RUN ln -sfv /bin/bash /bin/sh, with the SHELL instruction like SHELL ["/bin/bash", "-c"]. This approach keeps your Dockerfile clean and ensures consistent execution of shell commands.