fix(infra): resolve Docker Desktop WSL2 compatibility issues#2
Merged
Conversation
- postgres: mount volume at /var/lib/postgresql (postgres 18+ changed default data dir; /var/lib/postgresql/data mount was rejected) - kafka: bind CONTROLLER listener to kafka:9093 instead of 0.0.0.0:9093 (apache/kafka:3.9.0 wrapper included CONTROLLER in advertised.listeners, which is invalid with a non-routable address) - pom: set api.version=1.44 in failsafe JVM args so docker-java uses an API version compatible with Docker Desktop (MinAPIVersion: 1.40); docker-java 3.4.2 defaults to 1.24 which Docker Desktop rejects with 400
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.
Problem
Three issues prevented the stack from running on Docker Desktop with WSL2 integration:
PostgreSQL 18 changed its default data directory format. Mounting a volume at
/var/lib/postgresql/datais now rejected — the image expects a mount at/var/lib/postgresqland manages the versioned subdirectory itself.Kafka (apache/kafka:3.9.0) — the Docker wrapper incorrectly included the
CONTROLLERlistener inadvertised.listenerswhen it was bound to0.0.0.0.Kafka validates that advertised listeners cannot use non-routable addresses, causing
a startup failure.
Testcontainers (docker-java 3.4.2) defaults to Docker API version
1.24whenconnecting to the daemon. Docker Desktop enforces
MinAPIVersion: 1.40, returningHTTP 400 for any request using an older API version, which broke all IT tests.
Changes
docker-compose.yml— postgres volume mount:/var/lib/postgresql/data→/var/lib/postgresqldocker-compose.yml— kafka CONTROLLER listener:0.0.0.0:9093→kafka:9093pom.xml— failsafe system propertyapi.version=1.44so docker-java negotiates with a compatible API versionHow to test