Skip to content

DockerImageSource

Properties for how to produce a Docker image from a source.

Initializer

import { DockerImageSource } from '@alicloud/ros-cdk-assembly-schema'
const dockerImageSource: DockerImageSource = { ... }

Properties

Name Type Description
cacheDisabled boolean Disable the cache and pass --no-cache to the docker build command.
cacheFrom DockerCacheOption[] Cache from options to pass to the docker build command.
cacheTo DockerCacheOption Cache to options to pass to the docker build command.
directory string The directory containing the Docker image build instructions.
dockerBuildArgs {[ key: string ]: string} Additional build arguments.
dockerBuildSecrets {[ key: string ]: string} Additional build secrets.
dockerBuildSsh string SSH agent socket or keys.
dockerBuildTarget string Target build stage in a Dockerfile with multiple build stages.
dockerFile string The 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 string Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
platform string Platform to build for. Requires Docker Buildx.

cacheDisabledOptional

public readonly cacheDisabled: boolean;
  • Type: boolean
  • Default: cache is used

Disable the cache and pass --no-cache to the docker build command.


cacheFromOptional

public readonly cacheFrom: DockerCacheOption[];
  • Type: DockerCacheOption[]
  • Default: no cache from options are passed to the build command

Cache from options to pass to the docker build command.

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


cacheToOptional

public readonly cacheTo: DockerCacheOption;
  • Type: DockerCacheOption
  • Default: no cache to options are passed to the build command

Cache to options to pass to the docker build command.

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


directoryOptional

public readonly directory: string;
  • Type: string
  • 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.


dockerBuildArgsOptional

public readonly dockerBuildArgs: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No additional build arguments

Additional build arguments.

Only allowed when directory is set.


dockerBuildSecretsOptional

public readonly dockerBuildSecrets: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No additional build secrets

Additional build secrets.

Only allowed when directory is set.


dockerBuildSshOptional

public readonly dockerBuildSsh: string;
  • Type: string
  • Default: No ssh flag is set

SSH agent socket or keys.

Requires building with docker buildkit.


dockerBuildTargetOptional

public readonly dockerBuildTarget: string;
  • Type: string
  • Default: The last stage in the Dockerfile

Target build stage in a Dockerfile with multiple build stages.

Only allowed when directory is set.


dockerFileOptional

public readonly dockerFile: string;
  • Type: string
  • Default: "Dockerfile"

The name of the file with build instructions.

Only allowed when directory is set.


dockerOutputsOptional

public readonly dockerOutputs: string[];
  • Type: string[]
  • Default: no outputs are passed to the build command (default outputs are used)

Outputs.

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


executableOptional

public readonly executable: string[];
  • Type: string[]
  • 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.


networkModeOptional

public readonly networkMode: string;
  • Type: string
  • 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.


platformOptional

public readonly platform: string;
  • Type: string
  • Default: current machine platform

Platform to build for. Requires Docker Buildx.

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