ContainerNetwork¶
Connects a container to a network.
public sealed class ContainerNetwork
{
public ContainerNetwork(string name);
public string Name { get; set; }
public IList<string> Aliases { get; set; }
public HostName IPv4Address { get; set; }
public HostName IPv6Address { get; set; }
}
Notes:
Namemust be non-empty.Aliases,IPv4AddressandIPv6Addressare only supported on user-defined networks (notbridge,host,none, orcontainer:<name>).IPv4Addressmust be an IPv4 address andIPv6Addressmust be an IPv6 address.nulllets the network assign one.IPv6Addressrequires a network with IPv6 enabled.
Example: