Table of Contents

Interface IDockerRunOptions

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

Docker run options.

public interface IDockerRunOptions

Examples

// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK;
            var dockerRunOptions = new DockerRunOptions {
                Command = new [] { "command" },
                Entrypoint = new [] { "entrypoint" },
                Environment = new Dictionary<string, string> {
                    { "environmentKey", "environment" }
                },
                SecurityOpt = "securityOpt",
                User = "user",
                Volumes = new [] { new DockerVolume {
                    ContainerPath = "containerPath",
                    HostPath = "hostPath",

                    // the properties below are optional
                    Consistency = DockerVolumeConsistency.CONSISTENT
                } },
                WorkingDirectory = "workingDirectory"
            };

Remarks

ExampleMetadata: fixture=_generated

Properties

Command

The command to run in the container.

string[]? Command { get; }

Property Value

string[]

Remarks

Default: - run the command defined in the image

Entrypoint

The entrypoint to run in the container.

string[]? Entrypoint { get; }

Property Value

string[]

Remarks

Default: - run the entrypoint defined in the image

Environment

The environment variables to pass to the container.

IDictionary<string, string>? Environment { get; }

Property Value

IDictionary<string, string>

Remarks

Default: - no environment variables.

SecurityOpt

Security configuration when running the docker container.

string? SecurityOpt { get; }

Property Value

string

Remarks

Default: - no security options

User

The user to use when running the container.

string? User { get; }

Property Value

string

Remarks

Default: - root or image default

Volumes

Docker volumes to mount.

IDockerVolume[]? Volumes { get; }

Property Value

IDockerVolume[]

Remarks

Default: - no volumes are mounted

WorkingDirectory

Working directory inside the container.

string? WorkingDirectory { get; }

Property Value

string

Remarks

Default: - image default