fix(images): give the barbacane user a home directory - #235
Conversation
The standalone and control images create their user with useradd -r, which makes no home directory, while HOME still points at /home/barbacane. The compiler caches downloaded plugins under HOME, so compiling inside either image with a manifest that fetches plugins by URL failed: failed to create plugin cache directory ... Permission denied. The bundled plugins.yaml uses local paths, which is why the image's own compile example worked.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: barbacane-dev/barbacane/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Problem
Dockerfile.standaloneandDockerfile.controlcreate the user withuseradd -r, which makes no home directory, whileHOMEstays/home/barbacane. The compiler caches downloaded plugins under$HOME/.barbacane/cache/plugins, so compiling inside either image with a manifest that fetches plugins by URL fails:The bundled
/etc/barbacane/plugins.yamlloads plugins from local paths and never touches the cache, which is why the image's own "Compile a spec" example works.Fix
useradd -r -m, creating the home directory, in both images.Checked
Rebuilding the full image needs the Rust and plugin build stages, so the runtime stage was checked on its own:
debian:bookworm-slimwith the published 0.12.1 binary, plugins and manifest copied in, compiling a spec whose manifest fetchesmock.wasmby URL.barbacane-standalone:0.12.1failed to create plugin cache directoryuseradd -ruseradd -r -mcompiled 1 spec(s)The image build itself runs in the release workflow.