Interface DockerImageAssetOptions

All Superinterfaces:
FileCopyOptions, FileFingerprintOptions, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
AssetImageCodeProps, AssetImageProps, DockerImageAssetProps
All Known Implementing Classes:
AssetImageCodeProps.Jsii$Proxy, AssetImageProps.Jsii$Proxy, DockerImageAssetOptions.Jsii$Proxy, DockerImageAssetProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:29.058Z") @Stability(Stable) public interface DockerImageAssetOptions extends software.amazon.jsii.JsiiSerializable, FileFingerprintOptions
Options for DockerImageAsset.

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.*;
 NetworkMode networkMode;
 Platform platform;
 DockerImageAssetOptions dockerImageAssetOptions = DockerImageAssetOptions.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();
 
  • Method Details

    • getAssetName

      @Stability(Stable) @Nullable default String getAssetName()
      Unique identifier of the docker image asset and its potential revisions.

      Required if using AppScopedStagingSynthesizer.

      Default: - no asset name

    • getBuildArgs

      @Stability(Stable) @Nullable default Map<String,String> getBuildArgs()
      Build args to pass to the docker build command.

      Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl).

      Default: - no build args are passed

    • getBuildSecrets

      @Stability(Stable) @Nullable default Map<String,String> getBuildSecrets()
      Build secrets.

      Docker BuildKit must be enabled to use build secrets.

      Default: - no build secrets

      Example:

       import software.amazon.awscdk.DockerBuildSecret;
       Map<String, String> buildSecrets = Map.of(
               "MY_SECRET", DockerBuildSecret.fromSrc("file.txt"));
       

      See Also:
    • getBuildSsh

      @Stability(Stable) @Nullable default String getBuildSsh()
      SSH agent socket or keys to pass to the docker build command.

      Docker BuildKit must be enabled to use the ssh flag

      Default: - no --ssh flag

      See Also:
    • getCacheDisabled

      @Stability(Stable) @Nullable default Boolean getCacheDisabled()
      Disable the cache and pass --no-cache to the docker build command.

      Default: - cache is used

    • getCacheFrom

      @Stability(Stable) @Nullable default List<DockerCacheOption> getCacheFrom()
      Cache from options to pass to the docker build command.

      Default: - no cache from options are passed to the build command

      See Also:
    • getCacheTo

      @Stability(Stable) @Nullable default DockerCacheOption getCacheTo()
      Cache to options to pass to the docker build command.

      Default: - no cache to options are passed to the build command

      See Also:
    • getFile

      @Stability(Stable) @Nullable default String getFile()
      Path to the Dockerfile (relative to the directory).

      Default: 'Dockerfile'

    • getInvalidation

      @Stability(Stable) @Nullable default DockerImageAssetInvalidationOptions getInvalidation()
      Options to control which parameters are used to invalidate the asset hash.

      Default: - hash all parameters

    • getNetworkMode

      @Stability(Stable) @Nullable default NetworkMode getNetworkMode()
      Networking mode for the RUN commands during build.

      Support docker API 1.25+.

      Default: - no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used)

    • getOutputs

      @Stability(Stable) @Nullable default List<String> getOutputs()
      Outputs to pass to the docker build command.

      Default: - no outputs are passed to the build command (default outputs are used)

      See Also:
    • getPlatform

      @Stability(Stable) @Nullable default Platform getPlatform()
      Platform to build for.

      Requires Docker Buildx.

      Default: - no platform specified (the current machine architecture will be used)

    • getTarget

      @Stability(Stable) @Nullable default String getTarget()
      Docker target to build to.

      Default: - no target

    • builder

      @Stability(Stable) static DockerImageAssetOptions.Builder builder()
      Returns:
      a DockerImageAssetOptions.Builder of DockerImageAssetOptions