Interface DockerImageAssetSource

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
DockerImageAssetSource.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:02.176Z") @Stability(Stable) public interface DockerImageAssetSource extends software.amazon.jsii.JsiiSerializable
Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 DockerImageAssetSource dockerImageAssetSource = DockerImageAssetSource.builder()
         .sourceHash("sourceHash")
         // the properties below are optional
         .assetName("assetName")
         .directoryName("directoryName")
         .dockerBuildArgs(Map.of(
                 "dockerBuildArgsKey", "dockerBuildArgs"))
         .dockerBuildSecrets(Map.of(
                 "dockerBuildSecretsKey", "dockerBuildSecrets"))
         .dockerBuildSsh("dockerBuildSsh")
         .dockerBuildTarget("dockerBuildTarget")
         .dockerCacheDisabled(false)
         .dockerCacheFrom(List.of(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build()))
         .dockerCacheTo(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build())
         .dockerFile("dockerFile")
         .dockerOutputs(List.of("dockerOutputs"))
         .executable(List.of("executable"))
         .networkMode("networkMode")
         .platform("platform")
         .build();
 
  • Method Details

    • getSourceHash

      @Stability(Stable) @NotNull String getSourceHash()
      The hash of the contents of the docker build context.

      This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change.

      NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).

    • 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

    • getDirectoryName

      @Stability(Stable) @Nullable default String getDirectoryName()
      The directory where the Dockerfile is stored, must be relative to the cloud assembly root.

      Default: - Exactly one of `directoryName` and `executable` is required

    • getDockerBuildArgs

      @Stability(Stable) @Nullable default Map<String,String> getDockerBuildArgs()
      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).

      Only allowed when directoryName is specified.

      Default: - no build args are passed

    • getDockerBuildSecrets

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

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

      Only allowed when directoryName is specified.

      Default: - no build secrets are passed

    • getDockerBuildSsh

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

      Default: - no ssh arg is passed

    • getDockerBuildTarget

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

      Only allowed when directoryName is specified.

      Default: - no target

    • getDockerCacheDisabled

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

      Default: - cache is used

    • getDockerCacheFrom

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

      Default: - no cache from args are passed

    • getDockerCacheTo

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

      Default: - no cache to args are passed

    • getDockerFile

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

      Only allowed when directoryName is specified.

      Default: - no file

    • getDockerOutputs

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

      Default: - no build args are passed

    • getExecutable

      @Stability(Stable) @Nullable default List<String> getExecutable()
      An external command that will produce the packaged asset.

      The command should produce the name of a local Docker image on stdout.

      Default: - Exactly one of `directoryName` and `executable` is required

    • getNetworkMode

      @Stability(Stable) @Nullable default String getNetworkMode()
      Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.

      Specify this property to build images on a specific networking mode.

      Default: - no networking mode specified

    • getPlatform

      @Stability(Stable) @Nullable default String getPlatform()
      Platform to build for. Requires Docker Buildx.

      Specify this property to build images on a specific platform.

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

    • builder

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