java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.imagebuilder.alpha.DockerfileData
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
S3DockerfileData

@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)", date="2025-12-05T22:26:50.025Z") @Stability(Experimental) public abstract class DockerfileData extends software.amazon.jsii.JsiiObject
(experimental) Helper class for referencing and uploading dockerfile data for the container recipe.

Example:

 ContainerRecipe containerRecipe = ContainerRecipe.Builder.create(this, "CustomDockerfileContainerRecipe")
         .baseImage(BaseContainerImage.fromDockerHub("amazonlinux", "latest"))
         .targetRepository(Repository.fromEcr(Repository.fromRepositoryName(this, "Repository", "my-container-repo")))
         .dockerfile(DockerfileData.fromInline("\nFROM {{{ imagebuilder:parentImage }}}\nCMD [\"echo\", \"Hello, world!\"]\n{{{ imagebuilder:environments }}}\n{{{ imagebuilder:components }}}\n"))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    DockerfileData(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    DockerfileData(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fromAsset(software.constructs.Construct scope, String id, String path)
    (experimental) Uploads dockerfile data from a local file to S3 to use as the dockerfile data.
    fromAsset(software.constructs.Construct scope, String id, String path, AssetOptions options)
    (experimental) Uploads dockerfile data from a local file to S3 to use as the dockerfile data.
    (experimental) Uses an inline string as the dockerfile data.
    fromS3(IBucket bucket, String key)
    (experimental) References dockerfile data from a pre-existing S3 object.
    (experimental) The rendered Dockerfile value, for use in CloudFormation.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • DockerfileData

      protected DockerfileData(software.amazon.jsii.JsiiObjectRef objRef)
    • DockerfileData

      protected DockerfileData(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • DockerfileData

      @Stability(Experimental) protected DockerfileData()
  • Method Details

    • fromAsset

      @Stability(Experimental) @NotNull public static S3DockerfileData fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String path, @Nullable AssetOptions options)
      (experimental) Uploads dockerfile data from a local file to S3 to use as the dockerfile data.

      Parameters:
      scope - The construct scope. This parameter is required.
      id - Identifier of the construct. This parameter is required.
      path - The local path to the dockerfile data file. This parameter is required.
      options - S3 asset upload options.
    • fromAsset

      @Stability(Experimental) @NotNull public static S3DockerfileData fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String path)
      (experimental) Uploads dockerfile data from a local file to S3 to use as the dockerfile data.

      Parameters:
      scope - The construct scope. This parameter is required.
      id - Identifier of the construct. This parameter is required.
      path - The local path to the dockerfile data file. This parameter is required.
    • fromInline

      @Stability(Experimental) @NotNull public static DockerfileData fromInline(@NotNull String data)
      (experimental) Uses an inline string as the dockerfile data.

      Parameters:
      data - An inline string representing the dockerfile data. This parameter is required.
    • fromS3

      @Stability(Experimental) @NotNull public static S3DockerfileData fromS3(@NotNull IBucket bucket, @NotNull String key)
      (experimental) References dockerfile data from a pre-existing S3 object.

      Parameters:
      bucket - The S3 bucket where the dockerfile data is stored. This parameter is required.
      key - The S3 key of the dockerfile data file. This parameter is required.
    • render

      @Stability(Experimental) @NotNull public abstract DockerfileTemplateConfig render()
      (experimental) The rendered Dockerfile value, for use in CloudFormation.

      • For inline dockerfiles, dockerfileTemplateData is the Dockerfile template text
      • For S3-backed dockerfiles, dockerfileTemplateUri is the S3 URL