-
-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Description of the bug
When the Docker Host OS does not store its os-release in a file at /etc/os-release, dash. can fail to resolve it and instead surfaces the container's /etc/os-release. I discovered this using NixOS, which uses an absolute symlink in /etc/os-release which when fully followed yields the os-release in a completely different location.
From man os-release:
/usr/lib/os-releaseis the recommended place to store OS release information as part of vendor trees./etc/os-releaseshould be a relative symlink to/usr/lib/os-release, to provide compatibility with applications only looking at/etc/.
My home server runs NixOS which fastfetch displays properly:
But in dash., it shows as Ubuntu 20.04.6 LTS (as I run the :nvidia version, it shows Alpine on :latest):
I expect dash. to recursively resolve the links under /mnt/host until it locates os-release or gives up after a reasonable number of link evaluations. Technically the guidance says:
A relative symlink instead of an absolute symlink is necessary to avoid breaking the link in a chroot or initrd environment.
But dash. can reasonably work around this because the root is at a well-known /mnt/host/ when the dash. docker instructions are followed properly.
How to reproduce
- Install NixOS and verify that
less /etc/os-releaseshows the system info. - Double check that
/etc/os-releaseis a link withls -l /etc/os-release. - Run the latest dash. Docker container following the official guidance. You can also use the
:nvidiaversion. - Open dash. and the web view will improperly display the OS.
Theoretically other distros may fail too since the code expects:
const MNT_OS_PATH = '/mnt/host/etc/os-release';If any distro uses an absolute link (or an absolute link at any point in a chain of multiple links) to the real file, dash. will fail to properly resolve the os-release in Docker since absolute links do not resolve naturally when / is mounted under /mnt/host/.
Relevant log output
% docker compose logs -f dashdot
dashdot | listening on *:3001
dashdot | Using default network interface "wlp193s0"
dashdot | Using host os version from "/etc/os-release" and "/usr/lib/os-release"
dashdot | Static Server Info: {
dashdot | os: {
dashdot | arch: 'x64',
dashdot | distro: 'Ubuntu',
dashdot | kernel: '6.12.39',
dashdot | platform: 'linux',
dashdot | release: '20.04.6 LTS',
dashdot | uptime: 182917.07,
dashdot | dash_version: '6.1.0',
dashdot | dash_buildhash: 'ee73ec807e04018b3d14f6a915f7cb9311899428'
dashdot | },Info output of dashdot cli
% docker compose exec dashdot yarn cli info
INFO
=========
Yarn: 3.8.7
Node: v20.19.3
Dash: 6.1.0
Cwd: /app
Hash: ee73ec807e04018b3d14f6a915f7cb9311899428
Platform: Linux 9d388e26d93e 6.12.39 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jul 17 16:37:24 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Docker image: nvidia
In Docker: true
In Docker (env): true
In Podman: falseWhat browsers are you seeing the problem on?
All
Where is your instance running?
Linux Server (via Docker)
Additional context
I have a fix for this (#1233) that introduces the ability for dash. to resolve absolute links within its /mnt/host environment. I have confirmed that it properly resolves within my NixOS environment:
dash-1 | listening on *:3001
dash-1 | Using default network interface "wlp193s0"
dash-1 | Bound "/mnt/host/etc/os-release" → "/mnt/host/nix/store/f74y7ymw3g15zgfnh6k3prfzj0fcjfqg-etc-os-release" to "/etc/os-release" and "/usr/lib/os-release"
dash-1 | Using os-release from "/etc/os-release" or "/usr/lib/os-release"
dash-1 | Static Server Info: {
dash-1 | os: {
dash-1 | arch: 'x64',
dash-1 | distro: 'NixOS',
dash-1 | kernel: '6.12.39',
dash-1 | platform: 'linux',
dash-1 | release: '25.11',
dash-1 | uptime: 182342.09,
dash-1 | dash_version: 'unknown',
dash-1 | dash_buildhash: 'badc6cfd18a6850bde78a9a41afe97e43ad1bff3'
dash-1 | },