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

Support host.docker.internal instead of dockerhost #2966

Closed
hastinbe opened this issue May 7, 2021 · 2 comments · May be fixed by #2967
Closed

Support host.docker.internal instead of dockerhost #2966

hastinbe opened this issue May 7, 2021 · 2 comments · May be fixed by #2967

Comments

@hastinbe
Copy link
Contributor

hastinbe commented May 7, 2021

Description:

While troubleshooting why phpunit initialization was slow, I found there are DNS lookups for host.docker.internal that are not resolving from the workspace container.

Expected Behavior:

host.docker.internal should resolve to the docker host

Context information:

Output of git rev-parse HEAD

477428146e18c9038a4b094b01341f5fb573dd9f

Output of docker version

Docker version 19.03.3, build a872fc2f86
Docker version 20.10.6, build 370c289

Output of docker-compose version

docker-compose version 1.25.0, build 0a186604
docker-py version: 4.1.0
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

System info: Mac, Windows or Linux. Include which disto/version

Ubuntu 20.04.2 LTS

Stacktrace & Additional info:

08:12:30.546970 IP (tos 0x0, ttl 64, id 51572, offset 0, flags [DF], proto UDP (17), length 66)
    172.23.0.5.43187 > one.one.one.one.domain: 19394+ A? host.docker.internal. (38)

08:12:30.566670 IP (tos 0x0, ttl 58, id 30890, offset 0, flags [DF], proto UDP (17), length 141)
    one.one.one.one.domain > 172.23.0.5.43187: 19394 NXDomain 0/1/0 (113)

We should be getting a local response for host.docker.internal. Laradock is configured to use dockerhost for the docker host in docker-compose.yml. Replacing dockerhost with host.docker.internal in docker-compose.yml resolves this problem. Likewise host.docker.internal falls in-line with Mac and Windows, and recent support for it in docker 20.10.

hastinbe added a commit to hastinbe/laradock that referenced this issue May 7, 2021
Fixes laradock#2966 where current versions of laradock containers are already making DNS requests
to host.docker.internal which resolving NXDOMAIN when it should resolve.

See docker/for-linux#264
    moby/moby#40007
    https://docs.docker.com/engine/release-notes/#networking-2 for
    docker-engine 20.10

Signed-off-by: Beau Hastings <beau@saweet.net>
@stale
Copy link

stale bot commented Aug 5, 2021

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Aug 5, 2021
@stale
Copy link

stale bot commented Aug 27, 2021

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant