diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-10-19 15:25:06 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-10-20 10:31:15 -0400 |
commit | 1b288a35ba931c0b524af550749a7c1fd48b452f (patch) | |
tree | c13115fc7f40591e317f6025c5be608cdcd2c900 /libpod/oci_util.go | |
parent | 9f98b3447c7a1c34d328a387993722e4e7113cd2 (diff) | |
download | podman-1b288a35ba931c0b524af550749a7c1fd48b452f.tar.gz podman-1b288a35ba931c0b524af550749a7c1fd48b452f.tar.bz2 podman-1b288a35ba931c0b524af550749a7c1fd48b452f.zip |
Ensure that hostname is added to hosts with net=host
When a container uses --net=host the default hostname is set to
the host's hostname. However, we were not creating any entries
in `/etc/hosts` despite having a hostname, which is incorrect.
This hostname, for Docker compat, will always be the hostname of
the host system, not the container, and will be assigned to IP
127.0.1.1 (not the standard localhost address).
Also, when `--hostname` and `--net=host` are both passed, still
use the hostname from `--hostname`, not the host's hostname (we
still use the host's hostname by default in this case if the
`--hostname` flag is not passed).
Fixes #8054
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/oci_util.go')
0 files changed, 0 insertions, 0 deletions