Class AssetImage

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.ContainerImage
software.amazon.awscdk.services.ecs.AssetImage
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:22.994Z") @Stability(Stable) public class AssetImage extends ContainerImage
An image that will be built from a local directory with a Dockerfile.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.ecr.assets.*;
 import software.amazon.awscdk.services.ecs.*;
 NetworkMode networkMode;
 Platform platform;
 AssetImage assetImage = AssetImage.fromAsset("directory", AssetImageProps.builder()
         .assetName("assetName")
         .buildArgs(Map.of(
                 "buildArgsKey", "buildArgs"))
         .buildSecrets(Map.of(
                 "buildSecretsKey", "buildSecrets"))
         .buildSsh("buildSsh")
         .cacheDisabled(false)
         .cacheFrom(List.of(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build()))
         .cacheTo(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build())
         .exclude(List.of("exclude"))
         .extraHash("extraHash")
         .file("file")
         .followSymlinks(SymlinkFollowMode.NEVER)
         .ignoreMode(IgnoreMode.GLOB)
         .invalidation(DockerImageAssetInvalidationOptions.builder()
                 .buildArgs(false)
                 .buildSecrets(false)
                 .buildSsh(false)
                 .extraHash(false)
                 .file(false)
                 .networkMode(false)
                 .outputs(false)
                 .platform(false)
                 .repositoryName(false)
                 .target(false)
                 .build())
         .networkMode(networkMode)
         .outputs(List.of("outputs"))
         .platform(platform)
         .target("target")
         .build());
 
  • Constructor Details

    • AssetImage

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

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

      @Stability(Stable) public AssetImage(@NotNull String directory, @Nullable AssetImageProps props)
      Constructs a new instance of the AssetImage class.

      Parameters:
      directory - The directory containing the Dockerfile. This parameter is required.
      props -
    • AssetImage

      @Stability(Stable) public AssetImage(@NotNull String directory)
      Constructs a new instance of the AssetImage class.

      Parameters:
      directory - The directory containing the Dockerfile. This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public ContainerImageConfig bind(@NotNull software.constructs.Construct scope, @NotNull ContainerDefinition containerDefinition)
      Called when the image is used by a ContainerDefinition.

      Specified by:
      bind in class ContainerImage
      Parameters:
      scope - This parameter is required.
      containerDefinition - This parameter is required.