DockerImageAssetSource
Initializer
import { DockerImageAssetSource } from '@alicloud/ros-cdk-core'
const dockerImageAssetSource: DockerImageAssetSource = { ... }
Properties
Name | Type | Description |
---|---|---|
sourceHash |
string |
The hash of the contents of the docker build context. |
assetName |
string |
Unique identifier of the docker image asset and its potential revisions. |
directoryName |
string |
The directory where the Dockerfile is stored, must be relative to the cloud assembly root. |
dockerBuildArgs |
{[ key: string ]: string} |
Build args to pass to the docker build command. |
dockerBuildSACRets |
{[ key: string ]: string} |
Build sACRets to pass to the docker build command. |
dockerBuildSsh |
string |
SSH agent socket or keys to pass to the docker buildx command. |
dockerBuildTarget |
string |
Docker target to build to. |
dockerCacheDisabled |
boolean |
Disable the cache and pass --no-cache to the docker build command. |
dockerCacheFrom |
DockerCacheOption[] |
Cache from options to pass to the docker build command. |
dockerCacheTo |
DockerCacheOption |
Cache to options to pass to the docker build command. |
dockerFile |
string |
Path to the Dockerfile (relative to the directory). |
dockerOutputs |
string[] |
Outputs to pass to the docker build command. |
executable |
string[] |
An external command that will produce the packaged asset. |
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. |
sourceHash
Required
public readonly sourceHash: string;
- Type: string
The hash of the contents of the docker build context.
This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change.
NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).
assetName
Optional
public readonly assetName: string;
- Type: string
- Default: no asset name
Unique identifier of the docker image asset and its potential revisions.
Required if using AppScopedStagingSynthesizer.
directoryName
Optional
public readonly directoryName: string;
- Type: string
- Default: Exactly one of
directoryName
andexecutable
is required
The directory where the Dockerfile is stored, must be relative to the cloud assembly root.
dockerBuildArgs
Optional
public readonly dockerBuildArgs: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: no build args are passed
Build args to pass to the docker build
command.
Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens.
Only allowed when directoryName
is specified.
dockerBuildSACRets
Optional
public readonly dockerBuildSACRets: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: no build sACRets are passed
Build sACRets to pass to the docker build
command.
Since Docker build sACRets are resolved before deployment, keys and values cannot refer to unresolved tokens.
Only allowed when directoryName
is specified.
dockerBuildSsh
Optional
public readonly dockerBuildSsh: string;
- Type: string
- Default: no ssh arg is passed
SSH agent socket or keys to pass to the docker buildx
command.
dockerBuildTarget
Optional
public readonly dockerBuildTarget: string;
- Type: string
- Default: no target
Docker target to build to.
Only allowed when directoryName
is specified.
dockerCacheDisabled
Optional
public readonly dockerCacheDisabled: boolean;
- Type: boolean
- Default: cache is used
Disable the cache and pass --no-cache
to the docker build
command.
dockerCacheFrom
Optional
public readonly dockerCacheFrom: DockerCacheOption[];
- Type: DockerCacheOption[]
- Default: no cache from args are passed
Cache from options to pass to the docker build
command.
dockerCacheTo
Optional
public readonly dockerCacheTo: DockerCacheOption;
- Type: DockerCacheOption
- Default: no cache to args are passed
Cache to options to pass to the docker build
command.
dockerFile
Optional
public readonly dockerFile: string;
- Type: string
- Default: no file
Path to the Dockerfile (relative to the directory).
Only allowed when directoryName
is specified.
dockerOutputs
Optional
public readonly dockerOutputs: string[];
- Type: string[]
- Default: no build args are passed
Outputs to pass to the docker build
command.
executable
Optional
public readonly executable: string[];
- Type: string[]
- Default: Exactly one of
directoryName
andexecutable
is required
An external command that will produce the packaged asset.
The command should produce the name of a local Docker image on stdout
.
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: no platform specified (the current machine architecture will be used)
Platform to build for. Requires Docker Buildx.
Specify this property to build images on a specific platform.