fix(generate): use fully-qualified docker.io image in generated Dockerfiles#2847
Open
mikeland73 wants to merge 1 commit into
Open
fix(generate): use fully-qualified docker.io image in generated Dockerfiles#2847mikeland73 wants to merge 1 commit into
mikeland73 wants to merge 1 commit into
Conversation
…rfiles The Dockerfiles produced by 'devbox generate dockerfile' and 'devbox generate devcontainer' referenced the base image as an unqualified 'jetpackio/devbox:latest'. Container runtimes other than Docker (e.g. Podman, containerd/nerdctl, Buildah) do not implicitly default unqualified image names to Docker Hub, so the generated Dockerfile would fail to resolve the base image (or prompt for a registry) on those runtimes. Qualify the base image with the explicit 'docker.io/' registry so the generated Dockerfiles build consistently across runtimes. The images are published to Docker Hub under jetpackio/devbox[-root-user], so the prefix is correct. Fixes #2520
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes inconsistent image resolution across OCI runtimes by updating the Dockerfile templates generated by devbox generate dockerfile and devbox generate devcontainer to use a fully-qualified Docker Hub reference (docker.io/...) for the Devbox base images.
Changes:
- Updated the prod Dockerfile template to use
FROM docker.io/jetpackio/devbox:latest. - Updated the dev/devcontainer Dockerfile template (including the
--root-userbranch) to useFROM docker.io/jetpackio/devbox(-root-user):latest.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/devbox/generate/tmpl/prod.Dockerfile.tmpl | Qualifies the prod generated Dockerfile base image with docker.io/ for OCI-runtime compatibility. |
| internal/devbox/generate/tmpl/dev.Dockerfile.tmpl | Qualifies the dev/devcontainer generated Dockerfile base images (root/non-root variants) with docker.io/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Fixes #2520.
The Dockerfiles produced by
devbox generate dockerfileanddevbox generate devcontainerreferenced the base image with an unqualified name:Docker itself implicitly expands unqualified names to Docker Hub (
docker.io/), but other OCI runtimes do not. Podman, Buildah, and containerd/nerdctl either fail to resolve an unqualified reference or prompt the user to pick a registry (depending onregistries.conf). As the issue requests, the generated Dockerfile should use the fully-qualified image path so it builds consistently regardless of runtime.Changes
Qualify the base image with the explicit
docker.io/registry in both generated-Dockerfile templates:internal/devbox/generate/tmpl/dev.Dockerfile.tmpljetpackio/devbox:latest/jetpackio/devbox-root-user:latestdocker.io/jetpackio/devbox:latest/docker.io/jetpackio/devbox-root-user:latestinternal/devbox/generate/tmpl/prod.Dockerfile.tmpljetpackio/devbox:latestdocker.io/jetpackio/devbox:latestThe namespace is unchanged — these images are published to Docker Hub under
jetpackio/devboxandjetpackio/devbox-root-user(see.github/workflows/docker-image-release.yml), sodocker.io/is the correct prefix.How was it tested?
go build ./internal/devbox/generate/— clean.RootUsertrue/false) and confirmed everyFROMline now uses thedocker.io/prefix.testscripts/generate/dockerfile.test.txt,devcontainer.test.txt) only assert that the files are produced, so behavior is unaffected.cc @codegod100 (issue reporter)
Generated by Claude Code