DockerImageSource
Properties for how to produce a Docker image from a source.
Initializer
using AlibabaCloud.SDK.ROS.CDK.Assembly.Schema;
new DockerImageSource {
bool CacheDisabled = null,
DockerCacheOption[] CacheFrom = null,
DockerCacheOption CacheTo = null,
string Directory = null,
System.Collections.Generic.IDictionary<string, string> DockerBuildArgs = null,
System.Collections.Generic.IDictionary<string, string> DockerBuildSecrets = null,
string DockerBuildSsh = null,
string DockerBuildTarget = null,
string DockerFile = null,
string[] DockerOutputs = null,
string[] Executable = null,
string NetworkMode = null,
string Platform = null
};
Properties
Name | Type | Description |
---|---|---|
CacheDisabled |
bool |
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 |
System.Collections.Generic.IDictionary |
Additional build arguments. |
DockerBuildSecrets |
System.Collections.Generic.IDictionary |
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 bool CacheDisabled { get; set; }
- Type: bool
- Default: cache is used
Disable the cache and pass --no-cache
to the docker build
command.
CacheFrom
Optional
public DockerCacheOption[] CacheFrom { get; set; }
- 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 DockerCacheOption CacheTo { get; set; }
- 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 string Directory { get; set; }
- 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 System.Collections.Generic.IDictionary<string, string> DockerBuildArgs { get; set; }
- Type: System.Collections.Generic.IDictionary
- Default: No additional build arguments
Additional build arguments.
Only allowed when directory
is set.
DockerBuildSecrets
Optional
public System.Collections.Generic.IDictionary<string, string> DockerBuildSecrets { get; set; }
- Type: System.Collections.Generic.IDictionary
- Default: No additional build secrets
Additional build secrets.
Only allowed when directory
is set.
DockerBuildSsh
Optional
public string DockerBuildSsh { get; set; }
- Type: string
- Default: No ssh flag is set
SSH agent socket or keys.
Requires building with docker buildkit.
DockerBuildTarget
Optional
public string DockerBuildTarget { get; set; }
- 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 string DockerFile { get; set; }
- Type: string
- Default: "Dockerfile"
The name of the file with build instructions.
Only allowed when directory
is set.
DockerOutputs
Optional
public string[] DockerOutputs { get; set; }
- 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 string[] Executable { get; set; }
- 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 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: current machine platform
Platform to build for. Requires Docker Buildx.
Specify this property to build images on a specific platform/architecture.