Interface IDockerRunOptions
Docker run options.
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDockerRunOptions
Syntax (vb)
Public Interface IDockerRunOptions
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;
var dockerRunOptions = new DockerRunOptions {
Command = new [] { "command" },
Entrypoint = new [] { "entrypoint" },
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
Network = "network",
Platform = "platform",
SecurityOpt = "securityOpt",
User = "user",
Volumes = new [] { new DockerVolume {
ContainerPath = "containerPath",
HostPath = "hostPath",
// the properties below are optional
Consistency = DockerVolumeConsistency.CONSISTENT
} },
VolumesFrom = new [] { "volumesFrom" },
WorkingDirectory = "workingDirectory"
};
Synopsis
Properties
Command | The command to run in the container. |
Entrypoint | The entrypoint to run in the container. |
Environment | The environment variables to pass to the container. |
Network | Docker Networking options. |
Platform | Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+. |
SecurityOpt | Security configuration when running the docker container. |
User | The user to use when running the container. |
Volumes | Docker volumes to mount. |
VolumesFrom | Where to mount the specified volumes from. |
WorkingDirectory | Working directory inside the container. |
Properties
Command
The command to run in the container.
virtual string[] Command { get; }
Property Value
System.String[]
Remarks
Default: - run the command defined in the image
Entrypoint
The entrypoint to run in the container.
virtual string[] Entrypoint { get; }
Property Value
System.String[]
Remarks
Default: - run the entrypoint defined in the image
Environment
The environment variables to pass to the container.
virtual IDictionary<string, string> Environment { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - no environment variables.
Network
Docker Networking options.
virtual string Network { get; }
Property Value
System.String
Remarks
Default: - no networking options
Platform
Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.
virtual string Platform { get; }
Property Value
System.String
Remarks
Example value: linux/amd64
Default: - no platform specified
SecurityOpt
Security configuration when running the docker container.
virtual string SecurityOpt { get; }
Property Value
System.String
Remarks
Default: - no security options
User
The user to use when running the container.
virtual string User { get; }
Property Value
System.String
Remarks
Default: - root or image default
Volumes
Docker volumes to mount.
virtual IDockerVolume[] Volumes { get; }
Property Value
Remarks
Default: - no volumes are mounted
VolumesFrom
Where to mount the specified volumes from.
virtual string[] VolumesFrom { get; }
Property Value
System.String[]
Remarks
Default: - no containers are specified to mount volumes from
WorkingDirectory
Working directory inside the container.
virtual string WorkingDirectory { get; }
Property Value
System.String
Remarks
Default: - image default