Expose port 3306 only to the global default DB#100
Merged
peterjaap merged 1 commit intoApr 24, 2026
Conversation
Previously a single MySQL/MariaDB service in play would also grab port 3306, which conflicted with an existing default-version container left running from another project. Bind 3306 strictly to the version named by globalCfg.DefaultServices.MySQL (or MariaDB when no MySQL is configured), so only one container ever claims the standard port.
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
globalCfg.DefaultServices.MySQL(orMariaDBwhen no MySQL is configured), instead of also exposing it whenever a single DB service is in play.Bind for 0.0.0.0:3306 failed: port is already allocatederror when one project is using e.g. MySQL 5.7 while a default-version container (MySQL 8.0) is still running from another project.Test plan
make lintmake testDefaultServices.MySQL = 8.0, start a project using MySQL 5.7 whilemagebox-mysql-8.0is running — 5.7 comes up on 33057 only; 8.0 keeps 3306.DefaultServices.MariaDB) and no MySQL configured, confirm it binds 3306.