Class DockerBuildAssetOptions
Options when creating an asset from a Docker build.
Inheritance
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DockerBuildAssetOptions : Object, IDockerBuildAssetOptions, IDockerBuildOptions
Syntax (vb)
Public Class DockerBuildAssetOptions
Inherits Object
Implements IDockerBuildAssetOptions, IDockerBuildOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;
var dockerBuildAssetOptions = new DockerBuildAssetOptions {
BuildArgs = new Dictionary<string, string> {
{ "buildArgsKey", "buildArgs" }
},
CacheDisabled = false,
CacheFrom = new [] { new DockerCacheOption {
Type = "type",
// the properties below are optional
Params = new Dictionary<string, string> {
{ "paramsKey", "params" }
}
} },
CacheTo = new DockerCacheOption {
Type = "type",
// the properties below are optional
Params = new Dictionary<string, string> {
{ "paramsKey", "params" }
}
},
File = "file",
ImagePath = "imagePath",
OutputPath = "outputPath",
Platform = "platform",
TargetStage = "targetStage"
};
Synopsis
Constructors
DockerBuildAssetOptions() |
Properties
BuildArgs | Build args. |
CacheDisabled | Disable the cache and pass |
CacheFrom | Cache from options to pass to the |
CacheTo | Cache to options to pass to the |
File | Name of the Dockerfile, must relative to the docker build path. |
ImagePath | The path in the Docker image where the asset is located after the build operation. |
OutputPath | The path on the local filesystem where the asset will be copied using |
Platform | Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. |
TargetStage | Set build target for multi-stage container builds. Any stage defined afterwards will be ignored. |
Constructors
DockerBuildAssetOptions()
public DockerBuildAssetOptions()
Properties
BuildArgs
Build args.
public IDictionary<string, string> BuildArgs { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - no build args
CacheDisabled
Disable the cache and pass --no-cache
to the docker build
command.
public Nullable<bool> CacheDisabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - cache is used
CacheFrom
Cache from options to pass to the docker build
command.
public IDockerCacheOption[] CacheFrom { get; set; }
Property Value
Remarks
Default: - no cache from args are passed
CacheTo
Cache to options to pass to the docker build
command.
public IDockerCacheOption CacheTo { get; set; }
Property Value
Remarks
Default: - no cache to args are passed
File
Name of the Dockerfile, must relative to the docker build path.
public string File { get; set; }
Property Value
System.String
Remarks
Default: Dockerfile
ImagePath
The path in the Docker image where the asset is located after the build operation.
public string ImagePath { get; set; }
Property Value
System.String
Remarks
Default: /asset
OutputPath
The path on the local filesystem where the asset will be copied using docker cp
.
public string OutputPath { get; set; }
Property Value
System.String
Remarks
Default: - a unique temporary directory in the system temp directory
Platform
Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.
public string Platform { get; set; }
Property Value
System.String
Remarks
Example value: linux/amd64
Default: - no platform specified
TargetStage
Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.
public string TargetStage { get; set; }
Property Value
System.String
Remarks
Example value: build-env
Default: - Build all stages defined in the Dockerfile