Skip to content

DockerBuildOptions

Docker build options.

Initializer

import com.aliyun.ros.cdk.core.DockerBuildOptions;
DockerBuildOptions.builder()
//  .buildArgs(java.util.Map<java.lang.String, java.lang.String>)
//  .cacheDisabled(java.lang.Boolean)
//  .cacheFrom(java.util.List<DockerCacheOption>)
//  .cacheTo(DockerCacheOption)
//  .file(java.lang.String)
//  .platform(java.lang.String)
//  .targetStage(java.lang.String)
    .build();

Properties

Name Type Description
buildArgs java.util.Map Build args.
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.
file java.lang.String Name of the Dockerfile, must relative to the docker build path.
platform java.lang.String Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.
targetStage java.lang.String Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.

buildArgsOptional

public java.util.Map<java.lang.String, java.lang.String> getBuildArgs();
  • Type: java.util.Map
  • Default: no build args

Build args.


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();

Cache from options to pass to the docker build command.


cacheToOptional

public DockerCacheOption getCacheTo();

Cache to options to pass to the docker build command.


fileOptional

public java.lang.String getFile();
  • Type: java.lang.String
  • Default: Dockerfile

Name of the Dockerfile, must relative to the docker build path.


platformOptional

public java.lang.String getPlatform();
  • Type: java.lang.String
  • Default: no platform specified

Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.

Example value: linux/amd64


targetStageOptional

public java.lang.String getTargetStage();
  • Type: java.lang.String
  • Default: Build all stages defined in the Dockerfile

Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.

Example value: build-env