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. |
cacheDisabled
Optional
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.
cacheFrom
Optional
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.
cacheTo
Optional
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.
directory
Optional
public java.lang.String getDirectory();
- Type: java.lang.String
- Default: Exactly one of
directory
andexecutable
is required
The directory containing the Docker image build instructions.
This path is relative to the asset manifest location.
dockerBuildArgs
Optional
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.
dockerBuildSecrets
Optional
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.
dockerBuildSsh
Optional
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.
dockerBuildTarget
Optional
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.
dockerFile
Optional
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.
dockerOutputs
Optional
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
executable
Optional
public java.util.List<java.lang.String> getExecutable();
- Type: java.util.List
- Default: Exactly one of
directory
andexecutable
is required
A command-line executable that returns the name of a local Docker image on stdout after being run.
networkMode
Optional
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.
platform
Optional
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.