Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing host.docker.internal from a container #21986

Open
1 task done
kaisersly opened this issue Feb 7, 2025 · 0 comments
Open
1 task done

Accessing host.docker.internal from a container #21986

kaisersly opened this issue Feb 7, 2025 · 0 comments
Labels
status/triage Needs triage

Comments

@kaisersly
Copy link

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

I can't find what I'm looking for

Description

I have a service running on my host (python -m http.server 8111), I can't reach it from a container using host.docker.internal (curl http://host.docker.internal:8111 -> curl: (7) Failed to connect to host.docker.internal port 8111 after 0 ms: Couldn't connect to server).

To achieve this, I had to create two configuration files :

~/.config/systemd/user/docker.service.d/override.conf
[Service]
Environment="DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false"

~/.config/docker/daemon.json
{ "host-gateway-ip": "10.0.2.2" }

Location

https://docs.docker.com/engine/security/rootless/

Suggestion

It would be great if the problem and the solution appeared directly on the rootless page.

@kaisersly kaisersly added the status/triage Needs triage label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

1 participant