Skip to content

Accessing host.docker.internal from a container #21986

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

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

Accessing host.docker.internal from a container #21986

kaisersly opened this issue Feb 7, 2025 · 3 comments
Labels
area/engine Issue affects Docker engine/daemon lifecycle/frozen

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
@aevesdocker aevesdocker added area/engine Issue affects Docker engine/daemon and removed status/triage Needs triage labels Feb 11, 2025
@docker-robot
Copy link

docker-robot bot commented May 12, 2025

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

@kaisersly
Copy link
Author

/remove-lifecycle stale

@kaisersly
Copy link
Author

/lifecycle frozen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Issue affects Docker engine/daemon lifecycle/frozen
Projects
None yet
Development

No branches or pull requests

2 participants