Repository navigation
fix: install [packages] from claudebox install during image build - #116
Open
benjaminserguienko wants to merge 1 commit into
Open
benjaminserguienko wants to merge 1 commit into
benjaminserguienko wants to merge 1 commit into
Conversation
Reviewer's GuideThe build now converts Sequence diagram for installing project packages during image buildsequenceDiagram
participant CLI as claudebox install
participant Profiles as profiles.ini
participant Build as build_docker_image
participant Dockerfile as Generated Dockerfile
participant Apt as apt-get
CLI->>Profiles: Persist package names in [packages]
Build->>Profiles: read_profile_section(profiles_file, packages)
alt packages are present
Build->>Dockerfile: Add USER root
Build->>Dockerfile: Add apt-get update and apt-get install
Dockerfile->>Apt: Install package_list
Apt-->>Dockerfile: Clean package lists
else packages are empty or missing
Build->>Dockerfile: Omit package installation layer
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="main.sh" line_range="586" />
<code_context>
+ local package_list
+ package_list=$(printf '%s ' "${extra_packages[@]}")
+ profile_installations+=$'\n'"USER root"
+ profile_installations+=$'\n'"RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y ${package_list% } && apt-get clean && rm -rf /var/lib/apt/lists/*"
+ fi
+
</code_context>
<issue_to_address>
**Package values execute as root**
When a `[packages]` entry contains shell metacharacters, `package_list` is interpolated into the Dockerfile `RUN` command, so the build shell executes the added commands as root instead of treating the entry only as an apt package name.
Validate or safely escape package entries before inserting them into the Dockerfile `RUN` command.
Also at `main.sh:587`.
</issue_to_address>The restructure in 0e9a882 dropped the code that turned the profiles.ini [packages] section into an apt-get layer, so 'claudebox install' recorded packages that never reached the container. Restore it, running as root after the profile installations.
benjaminserguienko
force-pushed
the
fix/install-packages
branch
from
October 26, 2026 17:26
84a102e to
b0c96ff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: install
[packages]fromclaudebox installduring image buildProblem
claudebox install <packages>saves packages to the[packages]section of theproject's
profiles.ini, but they never reached the container, even afterclaudebox rebuild.The CLI overhaul in
1e621cc("refactor: complete CLI architecture overhaul")rewrote the image build in
scripts/bin/claudeboxand dropped the code thatturned
[packages]into anapt-get installlayer. A copy survived inscripts/bin/claudebox.olduntil42c6cf7deleted it. Since then the build hasread only the
[profiles]section.Fix
build_docker_imageinmain.shreads the[packages]section again. When itlists packages, the build adds this step after the profile installations:
IFScan't change how they are joined.[packages]is empty or missing.Tests
tests/test_dockerfile_generation.shnow writes a[packages]section(
pkg-config,libasound2-dev,libudev-dev) and checks that the generatedDockerfile installs those packages as root.
test_bash32_compat.sh,test_cli_bash32.sh,test_dockerfile_template.shandtest_runtime_regressions.sh.Notes
The automatic rebuild check doesn't watch
main.sh, so projects that alreadyran
claudebox installneed oneclaudebox rebuildafter upgrading to pick uptheir packages.
Summary by Sourcery
Restore installation of packages managed by
claudebox installduring image builds and prevent unsafe package values from reaching generated Dockerfiles.Bug Fixes:
Enhancements:
Tests: