DockerImageAssetSource
Initializer
using AlibabaCloud.SDK.ROS.CDK.Core;
new DockerImageAssetSource {
string SourceHash,
string AssetName = null,
string DirectoryName = null,
System.Collections.Generic.IDictionary<string, string> DockerBuildArgs = null,
System.Collections.Generic.IDictionary<string, string> DockerBuildSACRets = null,
string DockerBuildSsh = null,
string DockerBuildTarget = null,
bool DockerCacheDisabled = null,
DockerCacheOption[] DockerCacheFrom = null,
DockerCacheOption DockerCacheTo = null,
string DockerFile = null,
string[] DockerOutputs = null,
string[] Executable = null,
string NetworkMode = null,
string Platform = null
};
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 |
System.Collections.Generic.IDictionary |
Build args to pass to the docker build command. |
DockerBuildSACRets |
System.Collections.Generic.IDictionary |
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 |
bool |
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 string SourceHash { get; set; }
- 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 string AssetName { get; set; }
- Type: string
- Default: no asset name
Unique identifier of the docker image asset and its potential revisions.
Required if using AppScopedStagingSynthesizer.
DirectoryName
Optional
public string DirectoryName { get; set; }
- 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 System.Collections.Generic.IDictionary<string, string> DockerBuildArgs { get; set; }
- Type: System.Collections.Generic.IDictionary
- 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 System.Collections.Generic.IDictionary<string, string> DockerBuildSACRets { get; set; }
- Type: System.Collections.Generic.IDictionary
- 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 string DockerBuildSsh { get; set; }
- Type: string
- Default: no ssh arg is passed
SSH agent socket or keys to pass to the docker buildx
command.
DockerBuildTarget
Optional
public string DockerBuildTarget { get; set; }
- Type: string
- Default: no target
Docker target to build to.
Only allowed when directoryName
is specified.
DockerCacheDisabled
Optional
public bool DockerCacheDisabled { get; set; }
- Type: bool
- Default: cache is used
Disable the cache and pass --no-cache
to the docker build
command.
DockerCacheFrom
Optional
public DockerCacheOption[] DockerCacheFrom { get; set; }
- Type: DockerCacheOption[]
- Default: no cache from args are passed
Cache from options to pass to the docker build
command.
DockerCacheTo
Optional
public DockerCacheOption DockerCacheTo { get; set; }
- Type: DockerCacheOption
- Default: no cache to args are passed
Cache to options to pass to the docker build
command.
DockerFile
Optional
public string DockerFile { get; set; }
- Type: string
- Default: no file
Path to the Dockerfile (relative to the directory).
Only allowed when directoryName
is specified.
DockerOutputs
Optional
public string[] DockerOutputs { get; set; }
- Type: string[]
- Default: no build args are passed
Outputs to pass to the docker build
command.
Executable
Optional
public string[] Executable { get; set; }
- 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 string NetworkMode { get; set; }
- 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 string Platform { get; set; }
- 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.