Show / Hide Table of Contents

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

BuildArgs

Build args.

CacheDisabled

Disable the cache and pass --no-cache to the docker build command.

CacheFrom

Cache from options to pass to the docker build command.

CacheTo

Cache to options to pass to the docker build command.

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+.

TargetStage

Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.

Properties

BuildArgs

Build args.

IDictionary<string, string>? BuildArgs { get; }
Property Value

IDictionary<string, string>

Remarks

Default: - no build args

CacheDisabled

Disable the cache and pass --no-cache to the docker build command.

bool? CacheDisabled { get; }
Property Value

bool?

Remarks

Default: - cache is used

CacheFrom

Cache from options to pass to the docker build command.

IDockerCacheOption[]? CacheFrom { get; }
Property Value

IDockerCacheOption[]

Remarks

Default: - no cache from args are passed

CacheTo

Cache to options to pass to the docker build command.

IDockerCacheOption? CacheTo { get; }
Property Value

IDockerCacheOption

Remarks

Default: - no cache to args are passed

File

Name of the Dockerfile, must relative to the docker build path.

string? File { get; }
Property Value

string

Remarks

Default: Dockerfile

Platform

Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.

string? Platform { get; }
Property Value

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.

string? TargetStage { get; }
Property Value

string

Remarks

Example value: build-env

Default: - Build all stages defined in the Dockerfile

Back to top Generated by DocFX