Package org.openrewrite.docker
Class CombineRunInstructions
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.docker.CombineRunInstructions
- All Implemented Interfaces:
Cloneable
public class CombineRunInstructions
extends org.openrewrite.Recipe
Combines consecutive RUN instructions into a single RUN instruction.
This reduces the number of layers in the resulting Docker image, which:
- Decreases image size
- Improves build and pull performance
- Reduces the attack surface
Only shell form RUN instructions without flags are combined. Exec form and instructions with flags (like --mount) are preserved as-is.
-
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
-
CombineRunInstructions
public CombineRunInstructions()
-
-
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
-