Skip to content

feat(sandbox): add hosts file#445

Merged
kylewlacy merged 1 commit intomainfrom
add-sandbox-host-file
Mar 28, 2026
Merged

feat(sandbox): add hosts file#445
kylewlacy merged 1 commit intomainfrom
add-sandbox-host-file

Conversation

@jaudiger
Copy link
Copy Markdown
Contributor

@jaudiger jaudiger commented Mar 28, 2026

This PR adds /etc/hosts file with loopback entries (127.0.0.1 and ::1 for localhost) to the sandbox rootfs setup.

The issue has been discovered with Filebrowser v2.62.1 upgraded from Vite 7 to Vite 8 (which uses Rolldown as its bundler). Vite 8 resolves localhost via DNS during vite build. In the Brioche sandbox, /etc/hosts does not exist and /etc is read-only from the process perspective, so getaddrinfo fails with ENOTFOUND localhost, causing the build to fail.

Resolving localhost to the loopback address is a good assumption across normally all the softwares. The sandbox already provisions /etc/passwd and /etc/resolv.conf but was missing /etc/hosts.

Signed-off-by: Jérémy Audiger <jeremy.audiger@icloud.com>
@jaudiger jaudiger requested a review from kylewlacy March 28, 2026 18:57
@jaudiger jaudiger self-assigned this Mar 28, 2026
Copy link
Copy Markdown
Member

@kylewlacy kylewlacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great find!

@kylewlacy kylewlacy merged commit aaeaa7d into main Mar 28, 2026
10 checks passed
@kylewlacy kylewlacy deleted the add-sandbox-host-file branch March 28, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants