Show / Hide Table of Contents

Class BundlingOptions

Bundling options.

Inheritance
object
BundlingOptions
Implements
IBundlingOptions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BundlingOptions : IBundlingOptions
Syntax (vb)
Public Class BundlingOptions Implements IBundlingOptions
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK;


            var asset = new Asset(this, "BundledAsset", new AssetProps {
                Path = "/path/to/asset",
                Bundling = new BundlingOptions {
                    Image = DockerImage.FromRegistry("alpine"),
                    Command = new [] { "command-that-produces-an-archive.sh" },
                    OutputType = BundlingOutput.NOT_ARCHIVED
                }
            });

Synopsis

Constructors

BundlingOptions()

Bundling options.

Properties

BundlingFileAccess

The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.

Command

The command to run in the Docker container.

Entrypoint

The entrypoint to run in the Docker container.

Environment

The environment variables to pass to the Docker container.

Image

The Docker image where the command will run.

Local

Local bundling provider.

Network

Docker Networking options.

OutputType

The type of output that this bundling operation is producing.

Platform

Platform to build for. Requires Docker Buildx.

SecurityOpt

Security configuration when running the docker container.

User

The user to use when running the Docker container.

Volumes

Additional Docker volumes to mount.

VolumesFrom

Where to mount the specified volumes from.

WorkingDirectory

Working directory inside the Docker container.

Constructors

BundlingOptions()

Bundling options.

public BundlingOptions()
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK;


            var asset = new Asset(this, "BundledAsset", new AssetProps {
                Path = "/path/to/asset",
                Bundling = new BundlingOptions {
                    Image = DockerImage.FromRegistry("alpine"),
                    Command = new [] { "command-that-produces-an-archive.sh" },
                    OutputType = BundlingOutput.NOT_ARCHIVED
                }
            });

Properties

BundlingFileAccess

The access mechanism used to make source files available to the bundling container and to return the bundling output back to the host.

public BundlingFileAccess? BundlingFileAccess { get; set; }
Property Value

BundlingFileAccess?

Remarks

Default: - BundlingFileAccess.BIND_MOUNT

Command

The command to run in the Docker container.

public string[]? Command { get; set; }
Property Value

string[]

Remarks

Example value: ['npm', 'install']

Default: - run the command defined in the image

See: https://docs.docker.com/engine/reference/run/

Entrypoint

The entrypoint to run in the Docker container.

public string[]? Entrypoint { get; set; }
Property Value

string[]

Remarks

Example value: ['/bin/sh', '-c']

Default: - run the entrypoint defined in the image

See: https://docs.docker.com/engine/reference/builder/#entrypoint

Environment

The environment variables to pass to the Docker container.

public IDictionary<string, string>? Environment { get; set; }
Property Value

IDictionary<string, string>

Remarks

Default: - no environment variables.

Image

The Docker image where the command will run.

public DockerImage Image { get; set; }
Property Value

DockerImage

Remarks

ExampleMetadata: infused

Local

Local bundling provider.

public ILocalBundling? Local { get; set; }
Property Value

ILocalBundling

Remarks

The provider implements a method tryBundle() which should return true if local bundling was performed. If false is returned, docker bundling will be done.

Default: - bundling will only be performed in a Docker container

Network

Docker Networking options.

public string? Network { get; set; }
Property Value

string

Remarks

Default: - no networking options

OutputType

The type of output that this bundling operation is producing.

public BundlingOutput? OutputType { get; set; }
Property Value

BundlingOutput?

Remarks

Default: BundlingOutput.AUTO_DISCOVER

Platform

Platform to build for. Requires Docker Buildx.

public string? Platform { get; set; }
Property Value

string

Remarks

Specify this property to build images on a specific platform.

Default: - no platform specified (the current machine architecture will be used)

SecurityOpt

Security configuration when running the docker container.

public string? SecurityOpt { get; set; }
Property Value

string

Remarks

Default: - no security options

User

The user to use when running the Docker container.

public string? User { get; set; }
Property Value

string

Remarks

user | user:group | uid | uid:gid | user:gid | uid:group

Default: - uid:gid of the current user or 1000:1000 on Windows

See: https://docs.docker.com/engine/reference/run/#user

Volumes

Additional Docker volumes to mount.

public IDockerVolume[]? Volumes { get; set; }
Property Value

IDockerVolume[]

Remarks

Default: - no additional volumes are mounted

VolumesFrom

Where to mount the specified volumes from.

public string[]? VolumesFrom { get; set; }
Property Value

string[]

Remarks

Default: - no containers are specified to mount volumes from

See: https://docs.docker.com/engine/reference/commandline/run/#mount-volumes-from-container---volumes-from

WorkingDirectory

Working directory inside the Docker container.

public string? WorkingDirectory { get; set; }
Property Value

string

Remarks

Default: /asset-input

Implements

IBundlingOptions
Back to top Generated by DocFX