Convert devcontainer to Dockerfile-only build (enables envbuilder cache direct-boot)#32
Draft
bmorton wants to merge 1 commit into
Draft
Convert devcontainer to Dockerfile-only build (enables envbuilder cache direct-boot)#32bmorton wants to merge 1 commit into
bmorton wants to merge 1 commit into
Conversation
Install the full toolchain (Go, Ruby, Rust, kubectl/helm/minikube, gh, az, sshd, and the npm CLIs) directly in .devcontainer/Dockerfile instead of via devcontainer features. Coder's envbuilder cache probe cannot reproduce feature layers (coder/terraform-provider-envbuilder#68), so a feature-based devcontainer never hits the prebuilt-image cache and rebuilds every start. A pure-Dockerfile build is reproducible by the probe, enabling a direct boot from the cached image. Co-authored-by: Copilot <[email protected]>
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.
Why
Coder's envbuilder prebuilt-image cache probe (
envbuilder_cached_image) cannot reproduce devcontainer feature layers: features install from/.envbuilder/features/...during the build but/tmp/...during the probe, so the probe always misses withuncached RUN command is not supported in cache probe modeand the workspace rebuilds layer-by-layer every start. This is a known, open, version-independent upstream limitation: coder/terraform-provider-envbuilder#68.A pure-Dockerfile build (no
features:) is reproducible by the probe, so a cached workspace can boot directly from the prebuilt image — no build, no layer extraction.What this does
.devcontainer/Dockerfile— installs the entire toolchain viaRUNlayers, mirroring the previous feature set:1.26.3, Ruby4.0.5(ruby-build), Rust stable (rustup), kubectl/helm/minikube,gh,az, sshd (port 2222)@anthropic-ai/claude-code,@github/copilot,opencode-ai,@openprose/prose-clinsc, Playwright + Chromium, tmux config.devcontainer/devcontainer.json— removes thefeatures:block andoverrideFeatureInstallOrder; keepsremoteUser/containerUser/updateRemoteUserUID/postCreateCommand.devcontainer-lock.json(only relevant to features).Validation
I can't build locally (no Docker in my environment), so this is a draft for the
Build ContainersCI (Dockerfile build + envbuilder +devcontainer up) to validate. Once green and merged, theCache Devcontainerworkflow republishes the cache; then in Coder theenvbuilder_cached_imageprobe should returnexists=trueand workspaces boot directly from the prebuilt image.Notes / assumptions to review
@github/copilot→copilot,opencode-ai→opencode,@anthropic-ai/claude-code→claude.4.0.5is compiled via ruby-build (heavier build step than the rest).cache_repo/workspace_foldertemplate settings stay as-is).Co-authored-by: Copilot [email protected]