Summary
Alpine-based template builds fail at the base layer with two distinct exit status 127 errors.
Bug 1 — SyncChangesToDisk uses glibc-linked busybox
File: packages/orchestrator/pkg/template/build/sandboxtools/command.go
SyncChangesToDisk invokes rootfs.SandboxBusyBoxPath + " sync", which resolves to /usr/bin/busybox sync. The /usr/bin/busybox binary is compiled against glibc and cannot be executed on Alpine (musl libc) — it fails with exit status 127.
Bug 2 — /usr/bin/ionice and /usr/bin/nice missing on Alpine
File: packages/orchestrator/pkg/template/build/phases/base/distro/init.go (InitOpenRC)
envd's OOM wrapper hard-codes /usr/bin/ionice and /usr/bin/nice (handler.go):
exec /usr/bin/ionice -c 2 -n 4 /usr/bin/nice -n N ...
On Alpine, util-linux-misc installs ionice to /bin/ionice (not /usr/bin/ionice), and nice lives only at /bin/nice (busybox symlink). Verified:
$ docker run --rm alpine:3.22 sh -c 'apk add --no-cache util-linux-misc >/dev/null 2>&1; ls /usr/bin/ionice /usr/bin/nice 2>&1'
ls: /usr/bin/ionice: No such file or directory
ls: /usr/bin/nice: No such file or directory
Without symlinks at /usr/bin/ionice and /usr/bin/nice, every command envd spawns during the build step layer exits 127.
Fix
See linked PR: add /usr/bin/{ionice,nice} symlinks in the Alpine InitOpenRC provisioning step, and replace the glibc busybox path in SyncChangesToDisk with plain sync + explicit PATH.
Summary
Alpine-based template builds fail at the base layer with two distinct
exit status 127errors.Bug 1 —
SyncChangesToDiskuses glibc-linked busyboxFile:
packages/orchestrator/pkg/template/build/sandboxtools/command.goSyncChangesToDiskinvokesrootfs.SandboxBusyBoxPath + " sync", which resolves to/usr/bin/busybox sync. The/usr/bin/busyboxbinary is compiled against glibc and cannot be executed on Alpine (musl libc) — it fails with exit status 127.Bug 2 —
/usr/bin/ioniceand/usr/bin/nicemissing on AlpineFile:
packages/orchestrator/pkg/template/build/phases/base/distro/init.go(InitOpenRC)envd's OOM wrapper hard-codes
/usr/bin/ioniceand/usr/bin/nice(handler.go):On Alpine,
util-linux-miscinstallsioniceto/bin/ionice(not/usr/bin/ionice), andnicelives only at/bin/nice(busybox symlink). Verified:Without symlinks at
/usr/bin/ioniceand/usr/bin/nice, every command envd spawns during the build step layer exits 127.Fix
See linked PR: add
/usr/bin/{ionice,nice}symlinks in the AlpineInitOpenRCprovisioning step, and replace the glibc busybox path inSyncChangesToDiskwith plainsync+ explicit PATH.