Skip to content

fix(images): give the barbacane user a home directory - #235

Merged
ndreno merged 1 commit into
mainfrom
fix/image-home-directory
Sep 25, 2026
Merged

ndreno merged 1 commit into
mainfrom
fix/image-home-directory

Conversation

@ndreno

@ndreno ndreno commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Problem

Dockerfile.standalone and Dockerfile.control create the user with useradd -r, which makes no home directory, while HOME stays /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:

error: compilation failed: plugin resolution error: failed to create plugin cache directory /home/barbacane/.barbacane/cache/plugins: Permission denied (os error 13)

The bundled /etc/barbacane/plugins.yaml loads 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-slim with the published 0.12.1 binary, plugins and manifest copied in, compiling a spec whose manifest fetches mock.wasm by URL.

result
published barbacane-standalone:0.12.1 failed to create plugin cache directory
runtime stage with useradd -r same failure
runtime stage with useradd -r -m compiled 1 spec(s)

The image build itself runs in the release workflow.

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.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • deep-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: barbacane-dev/barbacane/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2d44aa70-0917-460a-8c2b-0c8236b356ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nicorp-pr-reviewer

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing Home Directory

The Dockerfile.control was modified to add the -m flag to useradd to ensure the barbacane user has a home directory. This resolves an issue where the compiler cached downloaded plugins under $HOME, which failed due to the missing directory and subsequent permission denied error.

RUN groupadd -r barbacane && useradd -r -m -g barbacane barbacane
Missing Home Directory

The Dockerfile.standalone was modified to add the -m flag to useradd to ensure the barbacane user has a home directory. This resolves an issue where the compiler cached downloaded plugins under $HOME, which failed due to the missing directory and subsequent permission denied error.

RUN groupadd -r barbacane && useradd -r -m -g barbacane barbacane

@ndreno
ndreno merged commit 9c49dce into main Sep 25, 2026
19 checks passed
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.

1 participant