Add host.containers.internal entry into container's etc/hosts

This change adds the entry `host.containers.internal` to the `/etc/hosts`
file within a new containers filesystem. The ip address is determined by
the containers networking configuration and points to the gateway address
for the containers networking namespace.

Closes #5651

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
This commit is contained in:
Baron Lenardson
2021-01-27 21:13:23 -06:00
parent d8dc56ba67
commit c8dfcce6db
5 changed files with 190 additions and 45 deletions

View File

@ -126,6 +126,8 @@ type Container struct {
// This is true if a container is restored from a checkpoint.
restoreFromCheckpoint bool
slirp4netnsSubnet *net.IPNet
}
// ContainerState contains the current state of the container