Package org.openrewrite.docker
Class UseExecFormEntrypoint
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.docker.UseExecFormEntrypoint
- All Implemented Interfaces:
Cloneable
public class UseExecFormEntrypoint
extends org.openrewrite.Recipe
Converts shell form ENTRYPOINT and CMD instructions to exec form (JSON array).
Exec form is preferred because:
- It does not invoke a command shell, avoiding shell string munging
- The command runs as PID 1 and properly receives Unix signals (like SIGTERM)
- Docker can properly stop the container on `docker stop`
Shell form wraps the command in /bin/sh -c "command", which can cause:
- The shell process (not your application) receives signals
- The application may not shut down gracefully
- Environment variable substitution behavior differences
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions
-
Constructor Details
-
UseExecFormEntrypoint
public UseExecFormEntrypoint()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-