Describe the bug
Apollo Router fails to resolve host machine subgraphs when running inside Docker on native Linux.
In a hybrid local development setup (Apollo Router in Docker, subgraphs running directly on the Linux host), using host.docker.internal in subgraph routing URLs causes Apollo Router to fail with a DNS resolution error.
To Reproduce
- Run Apollo Router inside Docker.
- Run GraphQL subgraphs directly on the Linux host.
- Configure the supergraph:
subgraphs:
example:
routing_url: http://host.docker.internal:5100/example
schema:
subgraph_url: http://host.docker.internal:5100/example
- Start Apollo Router.
- Execute a query that routes to the subgraph.
Expected behavior
Apollo Router should either:
- support resolving host machine services in Linux development environments, or
- clearly document the expected Linux networking setup for this scenario.
Actual behavior
Apollo Router fails with:
Upstream service error: Unexpected(reqwest::Error {
kind: Request,
url: "http://host.docker.internal:5100/beach",
source: hyper_util::client::legacy::Error(
Connect,
ConnectError(
"dns error",
Custom {
kind: Uncategorized,
error: "failed to lookup address information: Name or service not known"
}
)
)
})
Testing with the Docker bridge IP instead:
http://172.17.0.1:5100/beach
changes the failure to:
which suggests Apollo Router can reach the host network path, but host.docker.internal resolution is the blocking issue.
Environment
- OS: Arch Linux
- Docker Engine (native Linux)
- Apollo Router (Docker image)
- .NET Aspire local orchestration
- Subgraphs running directly on host machine
Describe the bug
Apollo Router fails to resolve host machine subgraphs when running inside Docker on native Linux.
In a hybrid local development setup (Apollo Router in Docker, subgraphs running directly on the Linux host), using
host.docker.internalin subgraph routing URLs causes Apollo Router to fail with a DNS resolution error.To Reproduce
Expected behavior
Apollo Router should either:
Actual behavior
Apollo Router fails with:
Upstream service error: Unexpected(reqwest::Error { kind: Request, url: "http://host.docker.internal:5100/beach", source: hyper_util::client::legacy::Error( Connect, ConnectError( "dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" } ) ) })Testing with the Docker bridge IP instead:
changes the failure to:
which suggests Apollo Router can reach the host network path, but
host.docker.internalresolution is the blocking issue.Environment