Modular sandbox: all languages depend on essentials, full sandbox assembles via COPY --from#38
Modular sandbox: all languages depend on essentials, full sandbox assembles via COPY --from#38
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #37
Split the monolithic sandbox into modular components: - ubuntu/24.04/common.sh: Shared functions and utilities - ubuntu/24.04/<language>/install.sh: Per-language install scripts - ubuntu/24.04/<language>/Dockerfile: Per-language Docker images - ubuntu/24.04/essentials-sandbox/: Minimal image with git identity tools - ubuntu/24.04/full-sandbox/: Complete image with all languages Languages supported as individual modules: js, python, go, rust, java, kotlin, dotnet, r, ruby, php, perl, swift, lean, rocq, cpp, assembly The root Dockerfile remains backward-compatible and continues to build the full sandbox image using the existing install script. CI/CD workflow updated to detect changes in ubuntu/ directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update all 16 language Dockerfiles to use repo-root-relative COPY paths so they can be built with `docker build -f ubuntu/24.04/<lang>/Dockerfile .` from the repository root. Also add common.sh COPY and remove the invalid COPY --from=entrypoint in js/Dockerfile. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update README.md with modular architecture table and usage examples - Update ARCHITECTURE.md with new file structure and modular design diagram - Fix essentials-sandbox and full-sandbox Dockerfiles to use repo root build context (docker build -f <path>/Dockerfile .) - Add changeset for minor version bump Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 7fb3fba.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Double check we only rebuild images, for which scripts or dockerfiles are changes, otherwise for the full sandbox we reuse latest versions of essentials and language specific sandboxes. Also make sure we have separate JavaScript version of sandbox, that essentials builds up on. So if we really want to, we can have JavaScript sandbox without any essentials also separately. So we should focus on efficiency of CI/CD flow. All language specific sandboxes should be built in parallel, and once required sandboxes builded, we can build essentials and full (after all including essentials is done). Ensure all changes are correct, consistent and fully meet all discussed requirements (check issue description and all comments in issue and in pull request). |
|
🤖 AI Work Session Started Starting automated work session at 2026-02-01T18:38:47.470Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Refactor the modular sandbox to use a proper layered Docker image hierarchy where each layer builds on top of the previous: - JS sandbox (konard/sandbox-js): standalone Node.js, Bun, Deno - Essentials sandbox (konard/sandbox-essentials): builds on JS, adds git, gh, glab, gh-setup-git-identity, glab-setup-git-identity - Full sandbox (konard/sandbox): builds on essentials, adds all remaining languages CI/CD workflow updated with per-image change detection: - Only rebuild images whose scripts/Dockerfiles actually changed - Reuse latest published images for unchanged base layers - JS sandbox amd64/arm64 built in parallel - Essentials waits for JS, then builds in parallel per arch - Full sandbox waits for essentials, then builds per arch - Each image gets its own multi-arch manifest Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root Dockerfile now builds on top of essentials-sandbox image using the full-sandbox/install.sh script, matching the layered architecture (JS → essentials → full). Removes dependency on legacy ubuntu-24-server-install.sh script. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The docker-build-test job now builds the full chain locally: JS → essentials → full sandbox, since the base images may not exist on registries yet during PR testing. Also adds separate test steps for JS and essentials sandboxes to verify each layer independently. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes MadeAddressed the feedback to create a layered Docker image architecture with efficient CI/CD: Architecture: JS → Essentials → FullKey Changes
Files Modified
|
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
We have lot's of duplicate dependencies like As most of language version are using lot's of duplicate packages installed in apt-get, we should put all duplicates in our sandbox-essentials, so there will be no conflicts between different versions. So full sandbox will merge files from all languages nicely. And most or all language versions will depend on sandbox-essentials, and also it will be available as sandbox-js alias without modification. And ensure all tests pass. |
|
🤖 AI Work Session Started Starting automated work session at 2026-02-01T20:00:00.616Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
- Add unzip to JS Dockerfile (required by Bun installer) - Move common dev libraries (libssl-dev, zlib1g-dev, libyaml-dev, etc.) from full-sandbox to essentials-sandbox to avoid duplication - Remove gh/glab-setup-git-identity from JS install.sh (belongs in essentials only, JS should be standalone without essentials overhead) - Move bubblewrap install from user-level heredoc to system-level in full-sandbox Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes MadeAddressed feedback to deduplicate dependencies and fix the CI failure: Fixes
ArchitectureCI StatusAll checks pass ✅ (docker-build-test builds all 3 layers and tests them) |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
You didn't understand me correctly. JS language and all other languages now should depend on sandbox-essentials, meaning each Dockerfile of language depends on konard/sandbox-essentials, and sh files also depend on konard/sandbox-essentials' sh file. So sh files depend on sh files, docker files depend on other docker images. And for konard/sandbox (full sandbox) I want to be able to copy/merge files from all others languages images + konard/sandbox-essentials image. And we also be specific with all versions we install of all software, so they don't conflicts on files copy/merging. So konard/sandbox should depend on almost all others docker images, that is why it will wait for them to finish building to be assembled. |
|
🤖 AI Work Session Started Starting automated work session at 2026-02-01T20:51:08.547Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
…-from Redesign architecture so every language image builds on top of konard/sandbox-essentials (not ubuntu:24.04), and the full sandbox (konard/sandbox) merges all language images via multi-stage COPY --from. Key changes: - All 15 language Dockerfiles now use FROM konard/sandbox-essentials - Language install.sh scripts no longer install duplicate system deps - Full sandbox Dockerfile uses COPY --from for 11 user-home languages (python, go, rust, java, kotlin, ruby, php, perl, swift, lean, rocq) - System packages (.NET, R, C/C++, Assembly) still installed via apt - CI/CD uses matrix strategy for parallel language builds (amd64+arm64) - Full sandbox waits for all language images before assembly - bashrc configs merged from all language stages - README and ARCHITECTURE updated with new diagrams Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --chown=sandbox:sandbox to COPY directives in all language Dockerfiles that run as USER sandbox. The essentials base image ends with USER sandbox, so COPY creates root-owned files that the sandbox user cannot chmod. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move ESSENTIALS_IMAGE ARG declaration before all FROM statements in both root Dockerfile and full-sandbox Dockerfile. Docker ARGs declared after FROM are stage-scoped and lose their values for subsequent stages, causing "base name should not be blank" errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The opam install script was receiving "y" as installation path instead of accepting the default. Fix by providing the correct path ($HOME/.local/bin) as first input. Also add fallback direct binary download and ensure .opam directory always exists for COPY --from. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Implements the modular sandbox architecture requested in #37. All language Docker images now depend on
konard/sandbox-essentials, and the full sandbox (konard/sandbox) assembles all language runtimes via multi-stageCOPY --from.Architecture
Key Changes
FROM ubuntu:24.04→FROM konard/sandbox-essentials:latest/tmp/common.shfallback for Docker build context; removed duplicate apt installsCOPY --fromassembly from 11 language image stagesHow Full Sandbox Assembly Works
$HOME/.<tool>(e.g.,.pyenv,.cargo,.go)COPY --from=<lang>-stagecopies each runtime directory.bashrcfiles from all stages are merged (unique lines appended)CI/CD Pipeline
Test Plan
docker-build-testpasses - builds all 11 language images + full sandboxnode --version,bun --version,deno --version)git --version,gh --version)Fixes #37
🤖 Generated with Claude Code