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

Error response from daemon: invalid IP address in add-host: "host-gateway". #2664

Closed
pheel opened this issue Jul 30, 2020 · 8 comments
Closed

Comments

@pheel
Copy link

pheel commented Jul 30, 2020

❯ docker --version
Docker version 19.03.12, build 48a66213fe

(via Docker Desktop CE 2.3.0.4 on MacOS)

#2337 adds a bit of code exempting host-gateway from validation. I was excited for 19.03.12 to come out on MacOS, to test if we could finally rely on host.docker.internal across platforms.

However:

❯ docker run --add-host host.docker.internal:host-gateway hey:latest
docker: Error response from daemon: invalid IP address in add-host: "host-gateway".

Any idea how this could be, given the PR referenced above?

@thaJeztah
Copy link
Member

The feature itself is not yet in the Docker 19.03 (daemon); the PR removed the validation in the cli, delegating the validation to the daemon, so that once docker 20.0x is released, a 19.03 cli would be able to use the feature that the 20.0x daemon provides.

So this is currently expected.

Let me close this issue because of the above, but feel free to continue the discussion

@DeltiKron
Copy link

I stumbled across this issue while experiencing the same problem, so for anyone else, I'll leave my solution here: Upgrading to the latest prefect version (0.15.6) fixed the problem.

@atilkan
Copy link

atilkan commented Jun 29, 2022

@DeltiKron Updating what exactly?

@gregorylegarec
Copy link

@DeltiKron same question than @atilkan :)

@akashp1712
Copy link

If anyone else facing the same issue in Docker version 19 or below, I've tried following technique and it worked for me.

--add-host=host.docker.interna:$(ip addr show docker0 | grep -Po 'inet \K[\d.]+')

PS: I found above solution from StackOverflow answer, I'll place credit link once I find.

@elrokket
Copy link

If anyone else facing the same issue in Docker version 19 or below, I've tried following technique and it worked for me.

--add-host=host.docker.interna:$(ip addr show docker0 | grep -Po 'inet \K[\d.]+')

PS: I found above solution from StackOverflow answer, I'll place credit link once I find.

how and where set this?

@g-kartik
Copy link

g-kartik commented Apr 3, 2024

I am still facing this issue
Docker Compose version v2.23.3
Docker version 26.0.0, build 2ae903e

@Isuxiz
Copy link

Isuxiz commented Jul 12, 2024

If anyone else facing the same issue in Docker version 19 or below, I've tried following technique and it worked for me.
--add-host=host.docker.interna:$(ip addr show docker0 | grep -Po 'inet \K[\d.]+')
PS: I found above solution from StackOverflow answer, I'll place credit link once I find.

how and where set this?

As I tried, add this in docker run ....

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

No branches or pull requests

9 participants