Class NetworkMode
networking mode on build time supported by docker.
Namespace: Amazon.CDK.AWS.Ecr.Assets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class NetworkMode : DeputyBase
Syntax (vb)
Public Class NetworkMode Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Ecr.Assets;
var asset = new DockerImageAsset(this, "MyBuildImage", new DockerImageAssetProps {
Directory = Join(__dirname, "my-image"),
NetworkMode = NetworkMode.HOST
});
Synopsis
Properties
DEFAULT | The default networking mode if omitted, create a network stack on the default Docker bridge. |
HOST | Use the Docker host network stack. |
Mode | The networking mode to use for docker build. |
NONE | Disable the network stack, only the loopback device will be created. |
Methods
Custom(string) | Used to specify a custom networking mode Use this if the networking mode name is not yet supported by the CDK. |
FromContainer(string) | Reuse another container's network stack. |
Properties
DEFAULT
The default networking mode if omitted, create a network stack on the default Docker bridge.
public static NetworkMode DEFAULT { get; }
Property Value
Remarks
ExampleMetadata: infused
HOST
Use the Docker host network stack.
public static NetworkMode HOST { get; }
Property Value
Remarks
ExampleMetadata: infused
Mode
The networking mode to use for docker build.
public virtual string Mode { get; }
Property Value
Remarks
ExampleMetadata: infused
NONE
Disable the network stack, only the loopback device will be created.
public static NetworkMode NONE { get; }
Property Value
Remarks
ExampleMetadata: infused
Methods
Custom(string)
Used to specify a custom networking mode Use this if the networking mode name is not yet supported by the CDK.
public static NetworkMode Custom(string mode)
Parameters
- mode string
The networking mode to use for docker build.
Returns
Remarks
ExampleMetadata: infused
FromContainer(string)
Reuse another container's network stack.
public static NetworkMode FromContainer(string containerId)
Parameters
- containerId string
The target container's id or name.
Returns
Remarks
ExampleMetadata: infused