Skip to content

fix(infra): resolve Docker Desktop WSL2 compatibility issues#2

Merged
lmoraesdev merged 2 commits into
mainfrom
develop
Jun 3, 2026
Merged

fix(infra): resolve Docker Desktop WSL2 compatibility issues#2
lmoraesdev merged 2 commits into
mainfrom
develop

Conversation

@lmoraesdev
Copy link
Copy Markdown
Owner

Problem

Three issues prevented the stack from running on Docker Desktop with WSL2 integration:

  1. PostgreSQL 18 changed its default data directory format. Mounting a volume at
    /var/lib/postgresql/data is now rejected — the image expects a mount at
    /var/lib/postgresql and manages the versioned subdirectory itself.

  2. Kafka (apache/kafka:3.9.0) — the Docker wrapper incorrectly included the
    CONTROLLER listener in advertised.listeners when it was bound to 0.0.0.0.
    Kafka validates that advertised listeners cannot use non-routable addresses, causing
    a startup failure.

  3. Testcontainers (docker-java 3.4.2) defaults to Docker API version 1.24 when
    connecting to the daemon. Docker Desktop enforces MinAPIVersion: 1.40, returning
    HTTP 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/postgresql
  • docker-compose.yml — kafka CONTROLLER listener: 0.0.0.0:9093kafka:9093
  • pom.xml — failsafe system property api.version=1.44 so docker-java negotiates with a compatible API version

How to test

docker compose down -v
docker compose up -d
./mvnw verify

- 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
@lmoraesdev lmoraesdev merged commit 5d35df0 into main Jun 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant