Skip to content

libdocker: fix empty container IP on Docker Desktop for macOS#1411

Open
qu0b wants to merge 1 commit intoethereum:masterfrom
qu0b:qu0b/fix-empty-container-ip
Open

libdocker: fix empty container IP on Docker Desktop for macOS#1411
qu0b wants to merge 1 commit intoethereum:masterfrom
qu0b:qu0b/fix-empty-container-ip

Conversation

@qu0b
Copy link
Copy Markdown
Contributor

@qu0b qu0b commented Mar 27, 2026

Summary

  • On newer macOS Docker Desktop versions, NetworkSettings.IPAddress from Docker's inspect API returns empty for containers on the default bridge network. This causes hiveproxy to report addr=:8081 (no IP), resulting in HIVE_SIMULATOR=http://:8081 which the simulator cannot reach (connection refused).
  • Falls back to iterating NetworkSettings.Networks endpoint map when the top-level IP is empty — the canonical Docker API source for per-network IPs.
  • Fails fast with a clear error if no IP is found from either source, instead of silently propagating an empty IP.

Test plan

  • Run hive on macOS Docker Desktop and verify the simulator connects successfully
  • Run hive on Linux Docker to confirm no behavioral change (fallback is gated on empty IP)

On newer macOS Docker Desktop versions, the top-level
NetworkSettings.IPAddress from Docker's inspect API can be empty even
though the container has a valid IP on the bridge network. This caused
hiveproxy to bind to `:8081` (no IP), making HIVE_SIMULATOR=http://:8081
unreachable for the simulator container.

Fall back to iterating NetworkSettings.Networks when the top-level IP is
empty, and fail fast with a clear error if no IP is found at all.
@fjl
Copy link
Copy Markdown
Collaborator

fjl commented Mar 31, 2026

The change looks OK to me. Let me know when you have tested it.

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