Interface DockerImageSource

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

    @Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)",
               date="2026-07-30T08:06:26.698Z")
    @Stability(Stable)
    public interface DockerImageSource
    extends software.amazon.jsii.JsiiSerializable
    Properties for how to produce a Docker image from a source.

    Example:

     // The code below shows an example of how to instantiate this type.
     // The values are placeholders you should change.
     import software.amazon.awscdk.cloudassembly.schema.*;
     DockerImageSource dockerImageSource = DockerImageSource.builder()
             .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())
             .directory("directory")
             .dockerBuildArgs(Map.of(
                     "dockerBuildArgsKey", "dockerBuildArgs"))
             .dockerBuildContexts(Map.of(
                     "dockerBuildContextsKey", "dockerBuildContexts"))
             .dockerBuildSecrets(Map.of(
                     "dockerBuildSecretsKey", "dockerBuildSecrets"))
             .dockerBuildSsh("dockerBuildSsh")
             .dockerBuildTarget("dockerBuildTarget")
             .dockerFile("dockerFile")
             .dockerOutputs(List.of("dockerOutputs"))
             .executable(List.of("executable"))
             .networkMode("networkMode")
             .platform("platform")
             .build();
     
    • Method Detail

      • getCacheDisabled

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

        Default: - cache is used

      • getDirectory

        @Stability(Stable)
        @Nullable
        default String getDirectory()
        The directory containing the Docker image build instructions.

        This path is relative to the asset manifest location.

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

      • getDockerBuildArgs

        @Stability(Stable)
        @Nullable
        default Map<String,​String> getDockerBuildArgs()
        Additional build arguments.

        Only allowed when directory is set.

        Default: - No additional build arguments

      • getDockerBuildContexts

        @Stability(Stable)
        @Nullable
        default Map<String,​String> getDockerBuildContexts()
        Additional build contexts.

        Only allowed when directory is set.

        Default: - No additional build contexts

      • getDockerBuildSecrets

        @Stability(Stable)
        @Nullable
        default Map<String,​String> getDockerBuildSecrets()
        Additional build secrets.

        Only allowed when directory is set.

        Default: - No additional build secrets

      • getDockerBuildSsh

        @Stability(Stable)
        @Nullable
        default String getDockerBuildSsh()
        SSH agent socket or keys.

        Requires building with docker buildkit.

        Default: - No ssh flag is set

      • getDockerBuildTarget

        @Stability(Stable)
        @Nullable
        default String getDockerBuildTarget()
        Target build stage in a Dockerfile with multiple build stages.

        Only allowed when directory is set.

        Default: - The last stage in the Dockerfile

      • getDockerFile

        @Stability(Stable)
        @Nullable
        default String getDockerFile()
        The name of the file with build instructions.

        Only allowed when directory is set.

        Default: "Dockerfile"

      • getExecutable

        @Stability(Stable)
        @Nullable
        default List<String> getExecutable()
        A command-line executable that returns the name of a local Docker image on stdout after being run.

        Default: - Exactly one of `directory` 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/architecture.

        Default: - current machine platform