aws-cdk-lib.cloud_assembly_schema.DockerImageSource

interface DockerImageSource

LanguageType name
.NETAmazon.CDK.CloudAssembly.Schema.DockerImageSource
Gogithub.com/aws/aws-cdk-go/awscdk/v2/cloudassemblyschema#DockerImageSource
Javasoftware.amazon.awscdk.cloudassembly.schema.DockerImageSource
Pythonaws_cdk.cloud_assembly_schema.DockerImageSource
TypeScript (source)aws-cdk-lib » cloud_assembly_schema » DockerImageSource

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 { cloud_assembly_schema } from 'aws-cdk-lib';
const dockerImageSource: cloud_assembly_schema.DockerImageSource = {
  cacheFrom: [{
    type: 'type',

    // the properties below are optional
    params: {
      paramsKey: 'params',
    },
  }],
  cacheTo: {
    type: 'type',

    // the properties below are optional
    params: {
      paramsKey: 'params',
    },
  },
  directory: 'directory',
  dockerBuildArgs: {
    dockerBuildArgsKey: 'dockerBuildArgs',
  },
  dockerBuildSecrets: {
    dockerBuildSecretsKey: 'dockerBuildSecrets',
  },
  dockerBuildTarget: 'dockerBuildTarget',
  dockerFile: 'dockerFile',
  dockerOutputs: ['dockerOutputs'],
  executable: ['executable'],
  networkMode: 'networkMode',
  platform: 'platform',
};

Properties

NameTypeDescription
cacheFrom?DockerCacheOption[]Cache from options to pass to the docker build command.
cacheTo?DockerCacheOptionCache to options to pass to the docker build command.
directory?stringThe directory containing the Docker image build instructions.
dockerBuildArgs?{ [string]: string }Additional build arguments.
dockerBuildSecrets?{ [string]: string }Additional build secrets.
dockerBuildTarget?stringTarget build stage in a Dockerfile with multiple build stages.
dockerFile?stringThe name of the file with build instructions.
dockerOutputs?string[]Outputs.
executable?string[]A command-line executable that returns the name of a local Docker image on stdout after being run.
networkMode?stringNetworking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
platform?stringPlatform to build for. Requires Docker Buildx.

cacheFrom?

Type: DockerCacheOption[] (optional, default: no cache from options are passed to the build command)

Cache from options to pass to the docker build command.

See also: https://docs.docker.com/build/cache/backends/


cacheTo?

Type: DockerCacheOption (optional, default: no cache to options are passed to the build command)

Cache to options to pass to the docker build command.

See also: https://docs.docker.com/build/cache/backends/


directory?

Type: string (optional, default: Exactly one of directory and executable is required)

The directory containing the Docker image build instructions.

This path is relative to the asset manifest location.


dockerBuildArgs?

Type: { [string]: string } (optional, default: No additional build arguments)

Additional build arguments.

Only allowed when directory is set.


dockerBuildSecrets?

Type: { [string]: string } (optional, default: No additional build secrets)

Additional build secrets.

Only allowed when directory is set.


dockerBuildTarget?

Type: string (optional, default: The last stage in the Dockerfile)

Target build stage in a Dockerfile with multiple build stages.

Only allowed when directory is set.


dockerFile?

Type: string (optional, default: "Dockerfile")

The name of the file with build instructions.

Only allowed when directory is set.


dockerOutputs?

Type: string[] (optional, default: no outputs are passed to the build command (default outputs are used))

Outputs.

See also: https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs


executable?

Type: string[] (optional, default: Exactly one of directory and executable is required)

A command-line executable that returns the name of a local Docker image on stdout after being run.


networkMode?

Type: string (optional, default: no networking mode specified)

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.


platform?

Type: string (optional, default: current machine platform)

Platform to build for. Requires Docker Buildx.

Specify this property to build images on a specific platform/architecture.