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:
Nameis the network name and must be non-empty. A full network ID or unique ID prefix is also accepted.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: