Interface IDockerBuildOptions
Docker build options.
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDockerBuildOptions
Syntax (vb)
Public Interface IDockerBuildOptions
Remarks
ExampleMetadata: infused
Examples
new Function(this, "Function", new FunctionProps {
Code = Code.FromAsset("/path/to/handler", new AssetOptions {
Bundling = new BundlingOptions {
Image = DockerImage.FromBuild("/path/to/dir/with/DockerFile", new DockerBuildOptions {
BuildArgs = new Dictionary<string, string> {
{ "ARG1", "value1" }
}
}),
Command = new [] { "my", "cool", "command" }
}
}),
Runtime = Runtime.PYTHON_3_9,
Handler = "index.handler"
});
Synopsis
Properties
Build |
Build args. |
Cache |
Disable the cache and pass |
Cache |
Cache from options to pass to the |
Cache |
Cache to options to pass to the |
File | Name of the Dockerfile, must relative to the docker build path. |
Platform | Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. |
Target |
Set build target for multi-stage container builds. Any stage defined afterwards will be ignored. |
Properties
BuildArgs
Build args.
virtual IDictionary<string, string> BuildArgs { get; }
Property Value
System.
Remarks
Default: - no build args
CacheDisabled
Disable the cache and pass --no-cache
to the docker build
command.
virtual Nullable<bool> CacheDisabled { get; }
Property Value
System.
Remarks
Default: - cache is used
CacheFrom
Cache from options to pass to the docker build
command.
virtual IDockerCacheOption[] CacheFrom { get; }
Property Value
Remarks
Default: - no cache from args are passed
CacheTo
Cache to options to pass to the docker build
command.
virtual IDockerCacheOption CacheTo { get; }
Property Value
Remarks
Default: - no cache to args are passed
File
Name of the Dockerfile, must relative to the docker build path.
virtual string File { get; }
Property Value
System.
Remarks
Default: Dockerfile
Platform
Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.
virtual string Platform { get; }
Property Value
System.
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.
virtual string TargetStage { get; }
Property Value
System.
Remarks
Example value: build-env
Default: - Build all stages defined in the Dockerfile