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

Fix: Add extra_hosts for host.docker.internal on Linux #637

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jesusoviedo
Copy link

This update corrects the Docker Compose configuration to resolve the error when using the alias host.docker.internal on Linux systems. Since this alias does not resolve natively on Linux, the following entry was added to the affected container:

extra_hosts:
- "host.docker.internal:host-gateway"

With this change, containers that need to access host services via host.docker.internal will be able to do so correctly. For inter-container communication within the same network, it is recommended to use the service name directly.

This update corrects the Docker Compose configuration to resolve the error when using the alias `host.docker.internal` on Linux systems. Since this alias does not resolve natively on Linux, the following entry was added to the affected container:

  extra_hosts:
    - "host.docker.internal:host-gateway"

With this change, containers that need to access host services via `host.docker.internal` will be able to do so correctly. For inter-container communication within the same network, it is recommended to use the service name directly.
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.

1 participant