Skip to content

feat(docker): allow overriding the image org with DDEV_DOCKER_ORG - #54

Merged
rfay merged 1 commit into
mainfrom
ddevtest-pr
Aug 28, 2026
Merged

feat(docker): allow overriding the image org with DDEV_DOCKER_ORG#54
rfay merged 1 commit into
mainfrom
ddevtest-pr

Conversation

@rfay

@rfay rfay commented Aug 28, 2026

Copy link
Copy Markdown
Member

make release-prep TAG=v1.25.4-rc1 now works: the images are published under
that exact tag and the binary built from it pulls them, while latest stays on
the last stable release.

release-prep.sh and release-marker.sh accepted only vX.Y.Z, so a
prerelease could not be stamped at all. Underneath that,
image-build-push.yml added -t latest unconditionally alongside the release
tag, which is why release-management.md told you not to run release-prep for
a prerelease: the images would have been correct, but latest would have
followed an rc.

Two questions were tangled together behind the same ^vX\.Y\.Z$ regex, and
they want different answers:

  • Is this a release tag? Widened to accept -alpha/-beta/-rc in the
    three places that ask: pkg/docker/images.go, release-prep.sh, and
    release-marker.sh. Naming the kinds rather than accepting any suffix is
    what keeps git describe's v1.25.4-15-gabcdef1 and -dirty forms from
    being stamped as a release by accident.
  • Should this move latest? Only image-build-push.yml was wrong here, and
    it needs no regex: release-marker.sh has already vetted the shape, so a -
    in the tag means prerelease.

Resolving to the release tag at all is about what people see — ddev version
and docker images name v1.25.4-rc1 instead of a content hash nobody
recognizes — so a prerelease wants the same treatment a stable release gets.

Deliberately unchanged: validate-image-tag.sh's rejection of release-shaped
content tags (a branch named v1.25.4-rc1 would publish
...:v1.25.4-rc1-<hash>, a different string that can't shadow a real
prerelease image); the push-tagged-*.yml validation escape hatches, so a
manual dispatch still can't hand-push a prerelease tag; and the latest gates
in containers_shared.mk and build_image.sh, which are already stable-only
and sit in image hash paths, where an edit would force every image to be
rebuilt and republished for no behavior change.

containers/release-prep.sh v1.26.0-rc1
git diff   # every Dockerfile marked v1.26.0-rc1, each <TagVar>Branch set to it
containers/release-marker.sh ddev-webserver   # v1.26.0-rc1
make && .gotmp/bin/*/ddev version   # images named :v1.26.0-rc1

containers/release-prep.sh "$(git describe --tags --always --dirty)"
containers/release-prep.sh v1.26.0-preview1

Then reset with git checkout ..

TestResolveImageTag covers the accepted prerelease kinds plus -dirty and an
unrecognized suffix falling back to the content hash. release_prep_test.sh
asserts a prerelease stamps and reads back like a release, and its
rejected-tags list now carries the git describe shapes.

latest is not covered by either, since it only happens inside
image-build-push.yml.

No change to a stable release. Worth cutting one prerelease with this in place
before relying on it, since the latest behavior can only be observed in a
real workflow run.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com<!--
PR titles have very precise rules, please read
https://docs.ddev.com/en/stable/developers/building-contributing/#pull-request-title-guidelines

If this is a nontrivial contribution, please create an issue for discussion first, or discuss it first in Discord, https://ddev.com/s/discord. This will save you time and help direct the feature.
-->

Short Summary (TL;DR)

The Issue

  • Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER

How This PR Solves The Issue

Manual Testing Instructions

Automated Testing Overview

Release/Deployment Notes

 ddev#8753 [skip buildkite]

`DDEV_DOCKER_ORG` points a `ddev` binary at a different Docker Hub
organization for DDEV's own images, so a release built somewhere other than
`ddev/ddev` can be pull-tested. Unset, which is every normal build, nothing
changes.

- Fixes ddev#8753

`versionconstants.go` hardcodes the `ddev/` org, but the image workflows
resolve `DOCKER_ORG` to `ddevhq` for `ddev-test/ddev`. A binary built there
asks for `ddev/ddev-webserver:vX.Y.Z` while its images went to `ddevhq`, so
`ddev start` fails with `manifest unknown` and the release cannot be tested
end to end.

An unexported `imageRepo()` in `pkg/docker/images.go` swaps the org on the
five images DDEV pulls for itself: web (including `-prod`), db, ssh-agent,
router, and xhgui. `postgres` comes from upstream, has no org, and is
returned unchanged. With the variable unset `imageRepo()` returns its input,
so there is no new behavior for anyone not setting it.

```bash
ddev version -j | jq -r '.raw.web'   # ddev/ddev-webserver:<tag>

for i in ddev-webserver ddev-traefik-router ddev-ssh-agent; do
  docker tag ddev/$i:<tag> myorg/$i:<tag>
done
DDEV_DOCKER_ORG=myorg ddev poweroff && DDEV_DOCKER_ORG=myorg ddev start
docker ps --format '{{.Names}}\t{{.Image}}'   # every ddev image under myorg/
```

`ddev version` reports the resolved references, so it also shows the override
without starting anything.

`TestImageRepoDockerOrg` in `pkg/docker/images_test.go` covers the default,
the override across all five getters, `postgres` being left alone, and an
empty value falling back to `ddev`.

No behavior change unless `DDEV_DOCKER_ORG` is set. Documented under
release-management.md next to the `ddev-test/ddev` setup notes, since
pull-testing a release built there is what it exists for.

Known gaps, all left alone deliberately: `ddev/ddev-utilities` is not
redirected, `ddev delete images` does not discover images pulled under the
override org, and add-ons and other extra services keep naming their own
images, since those come from the add-on's `docker-compose.*.yaml` rather
than from here. None of them block pull-testing a release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Aug 28, 2026
@rfay
rfay merged commit 4c9058f into main Aug 28, 2026
6 checks passed
@rfay
rfay deleted the ddevtest-pr branch August 28, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant