From 706600a0d7c7fc488b427e2b72b8c300b97410f7 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 5 Nov 2023 16:19:39 +0200 Subject: fix: remove /etc/resolv.conf when the root file system is unmounted debootstrap seems to create it, so that it can resolve DNS names in the chroot. However, we don't want it in the final image. Signed-off-by: Lars Wirzenius Sponsored-by: author --- vmdb/plugins/mount_plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmdb/plugins/mount_plugin.py b/vmdb/plugins/mount_plugin.py index 30554b7..7a9faea 100644 --- a/vmdb/plugins/mount_plugin.py +++ b/vmdb/plugins/mount_plugin.py @@ -103,6 +103,10 @@ class MountStepRunner(vmdb.StepRunnerInterface): if mount_point is None: return + resolv_conf = os.path.join(mount_point, "etc/resolv.conf") + if os.path.exists(resolv_conf): + os.remove(resolv_conf) + try: vmdb.unmount(mount_point) except vmdb.NotMounted as e: -- cgit v1.2.1