Repository navigation
feat(config): re-implement dbimage config option, mirroring webimage - #8610
Merged
Merged
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
Member
Author
|
`dbimage`/`dbaimage` were removed from `DdevApp` in ddev#5274 (2023), while `webimage` was kept as an unofficial, discouraged escape hatch for pinning a custom container image. This restores the same capability for the db container: `dbimage` in config.yaml, `--db-image`/`--db-image-default` flags, the same "not recommended" comments, and default-stripping on write. Non-default `webimage`/`dbimage` are also now flagged by `ddev debug check-custom-config`, which previously only checked for custom files and had no notion of customized config.yaml values. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MMiHJAL7r6z29tAWiqguhA
stasadev
force-pushed
the
20260721_rfay_reimplement_dbimage
branch
from
July 30, 2026 12:12
ec6ebb9 to
356ffda
Compare
stasadev
force-pushed
the
20260721_rfay_reimplement_dbimage
branch
from
July 30, 2026 12:14
356ffda to
cbcc136
Compare
stasadev
approved these changes
Jul 30, 2026
stasadev
left a comment
Member
There was a problem hiding this comment.
Looks good to me.
I pushed one more commit to show the correct image in ddev version when it's run from within a project.
Member
Author
Fantastic! |
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.
The Issue
There is no linked issue. While investigating why
dbimageno longer works inconfig.yaml(it was removed from theDdevAppstruct in #5274 back in 2023), we found that its sibling option,webimage, was kept as an unofficial, discouraged way to pin a custom container image. This PR restores the same capability for the db container, for parity.How This PR Solves The Issue
DBImageback toDdevApp(yaml:"dbimage,omitempty"), matching the existingWebImagefield.GetDBImage()now prefers an explicitDBImageoverride, falling back to the default computed from database type/version.WriteConfig()stripsdbimageback out when it matches the computed default, exactly as it already does forwebimage.--db-image/--db-image-defaultflags toddev config, mirroring--web-image/--web-image-default.config.yamland todocs/content/users/configuration/config.md/docs/content/users/usage/commands.md.dbimagetopkg/ddevapp/schema.json.ddev debug check-custom-configpreviously only detected custom files, with no notion of a customizedconfig.yamlvalue. It now also flags non-defaultwebimage/dbimageas custom configuration.Manual Testing Instructions
ddev config --project-type=php --docroot=webddev config --db-image=ddev/ddev-dbserver-mariadb-11.8:v1.24.10(pick any valid tag different from the project's default db image).ddev/config.yamlhas adbimage:line with a "not recommended" comment above it.ddev startdocker inspect <project>-db --format '{{.Config.Image}}'and confirm it matches the pinned tag (with a-<project>-builtsuffix).ddev debug check-custom-configshould report thedbimageoverride under "Database" (and awebimageoverride, if set, under "Web server").ddev config --db-image-defaultshould remove the line fromconfig.yamlagain.Automated Testing Overview
pkg/ddevapp/config_test.go:TestReadConfignow assertsdbimage:is read fromtestdata/config.yamlintoapp.DBImage;TestNewConfigalready exercises the default-image fallback viaGetDBImage().cmd/ddev/cmd/config_test.go:TestConfigSetValuesnow round-trips--db-image/--db-image-defaultthroughddev config, matching the existing--web-imagecoverage.cmd/ddev/cmd/utility-check-custom-config_test.go: new subtest verifies bothwebimageanddbimageoverrides are reported byddev debug check-custom-config.Release/Deployment Notes
dbimageis intentionally undocumented as a "supported" feature — likewebimage, it's an advanced/discouraged escape hatch that can break on DDEV upgrades if the pinned image diverges from what DDEV expects. No migration is needed; existingdbimage:lines inconfig.yaml(which have been silently ignored since 2023) will now take effect again.