From f7095596b3e896a6bca29bcb0d2c83ffe5eac025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Audiger?= Date: Sat, 28 Mar 2026 19:53:41 +0100 Subject: [PATCH] feat(sandbox): add hosts file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémy Audiger --- crates/brioche-core/src/bake/process.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/brioche-core/src/bake/process.rs b/crates/brioche-core/src/bake/process.rs index a5b9dc94..d97387e2 100644 --- a/crates/brioche-core/src/bake/process.rs +++ b/crates/brioche-core/src/bake/process.rs @@ -1940,6 +1940,9 @@ async fn set_up_rootfs( .await .context("failed to create etc")?; + let etc_hosts_contents = "127.0.0.1 localhost\n::1 localhost\n"; + tokio::fs::write(etc_dir.join("hosts"), etc_hosts_contents).await?; + let etc_passwd_contents = format!( "{guest_username}:!x:{GUEST_UID_HINT}:{GUEST_GID_HINT}::{guest_home_dir}:/bin/sh\n", );