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. |
cacheDisabled
Optional
public readonly cacheDisabled: boolean;
- Type: boolean
- Default: cache is used
Disable the cache and pass --no-cache
to the docker build
command.
cacheFrom
Optional
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.
cacheTo
Optional
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.
directory
Optional
public readonly directory: string;
- Type: 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 readonly dockerBuildArgs: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: No additional build arguments
Additional build arguments.
Only allowed when directory
is set.
dockerBuildSecrets
Optional
public readonly dockerBuildSecrets: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: No additional build secrets
Additional build secrets.
Only allowed when directory
is set.
dockerBuildSsh
Optional
public readonly dockerBuildSsh: string;
- Type: string
- Default: No ssh flag is set
SSH agent socket or keys.
Requires building with docker buildkit.
dockerBuildTarget
Optional
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.
dockerFile
Optional
public readonly dockerFile: string;
- Type: string
- Default: "Dockerfile"
The name of the file with build instructions.
Only allowed when directory
is set.
dockerOutputs
Optional
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
executable
Optional
public readonly executable: string[];
- Type: string[]
- 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 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.
platform
Optional
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.