Commit Graph

2 Commits

Author SHA1 Message Date
Paul Holzinger a3b0ae033e add base_hosts_file field to containers.conf
base_hosts_file can be used to overwrite the default base host file
/etc/hosts which is used to copy hosts entries from this file into the
containers /etc/hosts file. As special value "image" can be used to copy
the entries from the image hosts file or "none" to not use a base file
at all. IF the value is empty we should use /etc/hosts as default.

Ref https://github.com/containers/podman/issues/13277
Ref https://github.com/containers/podman/issues/13748

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-21 11:39:56 +02:00
Paul Holzinger 41cbde0eb2 add new etchosts package
Add a new libnetwork/etchosts package to manage reading/writing hosts files.
This package exports four functions New(), Add(), AddIfExists() and Remove().
See the godoc comments on the functions.

Both podman and buildah should use this functions to make sure files are
generated identical.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-04-21 11:39:55 +02:00