ContainerExtraHost Class
An entry added to the /etc/hosts file of a container (--add-host).
public sealed class ContainerExtraHost : IEquatable<ContainerExtraHost>- Implements
Constructors
| Name | Description |
|---|---|
| ContainerExtraHost(string, string) | An entry added to the /etc/hosts file of a container (--add-host). |
ContainerExtraHost(string, string)
ContainerExtraHost.csAn entry added to the /etc/hosts file of a container (--add-host).
Parameters
Hostnamestring- The host name.
Addressstring- The IP address the host name resolves to, or
ContainerExtraHost.HostGateway.
Properties
| Name | Description |
|---|---|
| Address | Gets the IP address the host name resolves to, or ContainerExtraHost.HostGateway. |
| Hostname | Gets the host name. |
Address
ContainerExtraHost.csGets the IP address the host name resolves to, or ContainerExtraHost.HostGateway.
public string Address { get; init; }Property value
Hostname
ContainerExtraHost.csMethods
| Name | Description |
|---|---|
| Deconstruct(string, string) | |
| Equals(ContainerExtraHost?) | |
| Equals(object?) | |
| ForHostGateway(string) | Creates an entry that resolves a host name to the host, through ContainerExtraHost.HostGateway. |
| GetHashCode() | |
| ToString() |
Deconstruct(string, string)
Equals overloads
Equals(ContainerExtraHost?)
public bool Equals(ContainerExtraHost? other)No documentation is available.
Equals(object?)
ForHostGateway(string)
ContainerExtraHost.csCreates an entry that resolves a host name to the host, through ContainerExtraHost.HostGateway.
public static ContainerExtraHost ForHostGateway(string hostname = "host.docker.internal")Parameters
hostnamestring- The host name. Defaults to
ContainerExtraHost.DefaultHostGatewayHostname.
Returns
ContainerExtraHost The entry.
GetHashCode()
ToString()
Operators
| Name | Description |
|---|---|
| operator ==(ContainerExtraHost?, ContainerExtraHost?) | |
| operator !=(ContainerExtraHost?, ContainerExtraHost?) |
operator ==(ContainerExtraHost?, ContainerExtraHost?)
public static bool operator ==(ContainerExtraHost? left, ContainerExtraHost? right)No documentation is available.
operator !=(ContainerExtraHost?, ContainerExtraHost?)
public static bool operator !=(ContainerExtraHost? left, ContainerExtraHost? right)No documentation is available.
Constants
| Name | Description |
|---|---|
| DefaultHostGatewayHostname | The host name Docker Desktop resolves to the host on its own, and that ContainerExtraHost.ForHostGateway uses by default. |
| HostGateway | The special address the daemon replaces with the address of the host, which is how a container calls back to the test process on Linux. |
DefaultHostGatewayHostname
The host name Docker Desktop resolves to the host on its own, and that ContainerExtraHost.ForHostGateway uses by default.
public const string DefaultHostGatewayHostname = "host.docker.internal"HostGateway
The special address the daemon replaces with the address of the host, which is how a container calls back to the test process on Linux.
public const string HostGateway = "host-gateway"