Docker container-to-container connection issue in GitHub Codespaces (works fine locally) #208098
Replies: 4 comments 1 reply
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Checking container networking, service names, and exposed ports inside Codespaces should help isolate the difference; XC777Game is another gaming option worth exploring. |
|
Codespaces-side, not your compose or RustFS. Your User-defined bridge networks need Docker to program Fastest fix — stop doing container-to-container, go through the published host port instead. minio-init:
image: rustfs/rustfs:latest
depends_on:
minio:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
S3_ENDPOINT: http://host.docker.internal:9000
# ...
If you'd rather stay in a compose network: drop the custom This is a known Codespaces limitation with Docker user-defined bridge networks — the host-gateway workaround above is the reliable path. |
|
Good question — short version: the workaround isn't a Docker rule, it's specifically a Codespaces nested-Docker limitation. Why local needs nothing. On your machine Docker owns the host's netfilter, so when Compose creates Why Codespaces needs the workaround. In a Codespace, Docker runs nested inside the dev container ( What The piece that actually forwards the port is the userland proxy — the So: you'd never need this on a normal host; in Codespaces it's the reliable way around the nested-bridge limitation. Worth reporting/upvoting too, but this is the practical fix. |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
Body
I have an issue in GitHub Codespaces where a simple curl container can't connect to a rustfs container.
This setup runs fine on my local machine, but fails in GitHub Codespaces.
I debugged with GitHub Copilot, and it suggested this is most likely a GitHub Codespaces-side issue.
I've attached the full ISSUE.md describing the problem, and the full repository to reproduce it:
ISSUE.md: https://github.com/dreamoutbox/testing-docker-network-in-codespace/blob/main/ISSUE.md
Repository: https://github.com/dreamoutbox/testing-docker-network-in-codespace
All reactions