Skip to content

fix(run): resolve service IP from container address, not network gateway#100

Merged
Mcrich23 merged 1 commit into
Mcrich23:mainfrom
w1zdun:fix/ServiceIPAddress
Jun 7, 2026
Merged

fix(run): resolve service IP from container address, not network gateway#100
Mcrich23 merged 1 commit into
Mcrich23:mainfrom
w1zdun:fix/ServiceIPAddress

Conversation

@w1zdun

@w1zdun w1zdun commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Environment values matching a service name are substituted with that service's IP, but getIPForRunningService returned the attachment's ipv4Gateway — the same gateway for every container on the network — so e.g. DATABASE_HOST=db pointed at the gateway instead of the db container and dependents waited for the database forever. Use the attachment's own ipv4Address instead.

Environment values matching a service name are substituted with that
service's IP, but getIPForRunningService returned the attachment's
ipv4Gateway — the same gateway for every container on the network — so
e.g. DATABASE_HOST=db pointed at the gateway instead of the db
container and dependents waited for the database forever. Use the
attachment's own ipv4Address instead.
@Mcrich23 Mcrich23 merged commit a07b016 into Mcrich23:main Jun 7, 2026
Cyb3rDudu added a commit to Cyb3rDudu/Container-Compose that referenced this pull request Jun 30, 2026
Resolve ComposeUp.swift conflicts:
- getIPForRunningService: keep containerName(for:) helper, retain main's
  container-address comment (Mcrich23#100).
- waitUntilServiceIsRunning: adopt main's ActivityClock idle/maxWait
  signature (Mcrich23#112); keep containerName(for:) helper in place of the
  silent guard-let-projectName return.
- configService: keep BOTH Mcrich23#97's --dns-domain args and main's compose
  project/service labels (Mcrich23#110) — independent features at the same site.
- Failed-wait teardown: call stopExistingContainers([containerName]) (Mcrich23#97
  rename) instead of main's stopOldStuff([serviceName]); pass the actual
  launched name so dotted/explicit names are torn down correctly.

Builds clean; 63 static tests pass (DNS helpers, parsing, volumes, helpers).

Co-Authored-By: Claude <noreply@anthropic.com>
Cyb3rDudu added a commit to Cyb3rDudu/Container-Compose that referenced this pull request Jun 30, 2026
Resolve ComposeUp.swift conflicts:
- getIPForRunningService: keep containerName(for:) helper, retain main's
  container-address comment (Mcrich23#100).
- waitUntilServiceIsRunning: adopt main's ActivityClock idle/maxWait
  signature (Mcrich23#112); keep containerName(for:) helper in place of the
  silent guard-let-projectName return.
- configService: keep BOTH Mcrich23#97's --dns-domain args and main's compose
  project/service labels (Mcrich23#110) — independent features at the same site.
- Failed-wait teardown: call stopExistingContainers([containerName]) (Mcrich23#97
  rename) instead of main's stopOldStuff([serviceName]); pass the actual
  launched name so dotted/explicit names are torn down correctly.

Builds clean; 63 static tests pass (DNS helpers, parsing, volumes, helpers).
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.

2 participants