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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    org.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

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UseExecFormEntrypoint

      public UseExecFormEntrypoint()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in class org.openrewrite.Recipe
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.openrewrite.Recipe
    • getVisitor

      public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()
      Overrides:
      getVisitor in class org.openrewrite.Recipe