coreos-base/oem-gce: Bind mount nsswitch.conf for /etc/hosts

The host's /etc/nsswitch.conf is a symlink to
/usr/share/google-oslogin/nsswitch.conf
but that is not present in the rkt container.
Do not only bind-mount /etc but also the target
of the symlink. With a broken nsswitch.conf
any entries in /etc/hosts are not considered
which makes problems when a custom DNS server
is used.
This commit is contained in:
Kai Lüke 2020-01-24 16:09:18 +01:00
parent 0cc0511167
commit ccd08f7c32

View File

@ -19,6 +19,8 @@ ExecStart=/usr/bin/rkt run \
--volume=etc,kind=host,source=/etc,readOnly=false \
--volume=home,kind=host,source=/home,readOnly=false \
--volume=runsystemd,kind=host,source=/run/systemd,readOnly=false \
--volume=nsswitch,kind=host,source=/usr/share/google-oslogin/nsswitch.conf,readOnly=true \
--mount=volume=nsswitch,target=/usr/share/google-oslogin/nsswitch.conf \
/usr/share/oem/flatcar-oem-gce.aci
ExecStopPost=/usr/bin/rkt gc --mark-only