Skip to content

DockerImageSource

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

Initializer

import com.aliyun.ros.cdk.assembly.schema.DockerImageSource;
DockerImageSource.builder()
//  .cacheDisabled(java.lang.Boolean)
//  .cacheFrom(java.util.List<DockerCacheOption>)
//  .cacheTo(DockerCacheOption)
//  .directory(java.lang.String)
//  .dockerBuildArgs(java.util.Map<java.lang.String, java.lang.String>)
//  .dockerBuildSecrets(java.util.Map<java.lang.String, java.lang.String>)
//  .dockerBuildSsh(java.lang.String)
//  .dockerBuildTarget(java.lang.String)
//  .dockerFile(java.lang.String)
//  .dockerOutputs(java.util.List<java.lang.String>)
//  .executable(java.util.List<java.lang.String>)
//  .networkMode(java.lang.String)
//  .platform(java.lang.String)
    .build();

Properties

Name Type Description
cacheDisabled java.lang.Boolean Disable the cache and pass --no-cache to the docker build command.
cacheFrom java.util.List<DockerCacheOption> Cache from options to pass to the docker build command.
cacheTo DockerCacheOption Cache to options to pass to the docker build command.
directory java.lang.String The directory containing the Docker image build instructions.
dockerBuildArgs java.util.Map Additional build arguments.
dockerBuildSecrets java.util.Map Additional build secrets.
dockerBuildSsh java.lang.String SSH agent socket or keys.
dockerBuildTarget java.lang.String Target build stage in a Dockerfile with multiple build stages.
dockerFile java.lang.String The name of the file with build instructions.
dockerOutputs java.util.List Outputs.
executable java.util.List A command-line executable that returns the name of a local Docker image on stdout after being run.
networkMode java.lang.String Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
platform java.lang.String Platform to build for. Requires Docker Buildx.

cacheDisabledOptional

public java.lang.Boolean getCacheDisabled();
  • Type: java.lang.Boolean
  • Default: cache is used

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


cacheFromOptional

public java.util.List<DockerCacheOption> getCacheFrom();
  • Type: java.util.List<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 DockerCacheOption getCacheTo();
  • 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 java.lang.String getDirectory();
  • Type: java.lang.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 java.util.Map<java.lang.String, java.lang.String> getDockerBuildArgs();
  • Type: java.util.Map
  • Default: No additional build arguments

Additional build arguments.

Only allowed when directory is set.


dockerBuildSecretsOptional

public java.util.Map<java.lang.String, java.lang.String> getDockerBuildSecrets();
  • Type: java.util.Map
  • Default: No additional build secrets

Additional build secrets.

Only allowed when directory is set.


dockerBuildSshOptional

public java.lang.String getDockerBuildSsh();
  • Type: java.lang.String
  • Default: No ssh flag is set

SSH agent socket or keys.

Requires building with docker buildkit.


dockerBuildTargetOptional

public java.lang.String getDockerBuildTarget();
  • Type: java.lang.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 java.lang.String getDockerFile();
  • Type: java.lang.String
  • Default: "Dockerfile"

The name of the file with build instructions.

Only allowed when directory is set.


dockerOutputsOptional

public java.util.List<java.lang.String> getDockerOutputs();
  • Type: java.util.List
  • 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 java.util.List<java.lang.String> getExecutable();
  • Type: java.util.List
  • 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 java.lang.String getNetworkMode();
  • Type: java.lang.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 java.lang.String getPlatform();
  • Type: java.lang.String
  • Default: current machine platform

Platform to build for. Requires Docker Buildx.

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