Network Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a Docker network configuration as part of a Compose file.
[YamlDotNet.Serialization.YamlSerializable]
public sealed class Network : Aspire.Hosting.Docker.Resources.ComposeNodes.NamedComposeMember
[<YamlDotNet.Serialization.YamlSerializable>]
type Network = class
inherit NamedComposeMember
Public NotInheritable Class Network
Inherits NamedComposeMember
- Inheritance
- Attributes
-
YamlDotNet.Serialization.YamlSerializableAttribute
Remarks
This class encapsulates the properties and options related to a network in a Docker Compose file. It includes configurations such as driver type, options, labels, IPAM settings, and more.
Constructors
Network() |
Properties
Attachable |
Gets or sets a value indicating whether the network is attachable. When this property is set to true, containers can dynamically attach to the network at runtime. This feature is primarily used in Docker Swarm mode to enable service discovery and communication between services. |
Driver |
Gets or sets the driver used for the network. The driver determines the networking implementation that the container network is based on. Examples include bridge, overlay, host, etc. |
DriverOpts |
Represents a dictionary of driver-specific options for the network configuration in a Docker service node. |
External |
Indicates whether the network is external or managed by Docker outside of the application stack. When set to true, the network is assumed to be pre-existing and not defined by the application's configuration. When set to false or null, the network can be defined and created within the application scope. |
Ingress |
Represents whether the network is configured as an ingress network. An ingress network is used to manage the internal routing and load balancing for swarm services in Docker. |
Internal |
Determines if the network is restricted to internal usage only. When set to true, the network is not accessible externally. |
Ipam |
Represents the IP Address Management (IPAM) configuration for a network in a container environment. IPAM is used to manage network configurations such as custom IP ranges, subnets, and gateway settings. |
Labels |
Represents a collection of metadata labels applied to the network configuration. These labels can be used to organize, manage, or identify network resources. |
Name |
Gets or sets the name of the Docker Compose member. (Inherited from NamedComposeMember) |