From c37fbb8f683dd9d1ef782d3b1f87940e59ce176e Mon Sep 17 00:00:00 2001
From: godog <godog@autistici.org>
Date: Mon, 5 Apr 2021 17:42:24 +0200
Subject: [PATCH] float-base-docker: bindmount /etc/hosts inside containers

---
 roles/float-base-docker/templates/run.sh.j2 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/roles/float-base-docker/templates/run.sh.j2 b/roles/float-base-docker/templates/run.sh.j2
index f5933019..79476d14 100644
--- a/roles/float-base-docker/templates/run.sh.j2
+++ b/roles/float-base-docker/templates/run.sh.j2
@@ -118,6 +118,11 @@ exec /usr/bin/podman run \
   --rm --name {{ item.service }}-{{ item.container.name }} \
   --no-healthcheck \
   --replace \
+{# Bindmount /etc/hosts to pick up service moves (also disables podman's
+  /etc/hosts generation
+#}
+  --no-hosts \
+  --mount=type=bind,source=/etc/hosts,destination=/etc/hosts,ro=true \
   $opts \
 {% for opt in g.options %}
   {{ opt }} \
-- 
GitLab