-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Replicate --add-host behavior with extra_hosts #12088
Comments
I wonder: how will you use |
Hosts file allows multiple entries (both per hostname and per IP). It depends on the application (meaning whether or not they iterate over hosts in the file or just return the first match), but usually this means you can try one IP address and fallback to another if it fails. Obviously these requests both fail on the dummy IP address provided, but curl recognizes that there are two IPs for myhost, and falls back to the second options if the first fails. |
ok, we could remove this restriction, but this also would mean one cannot override value anymore, which could be considered a regression. as "long syntax" is the canonical model I hardly can imagine how to address this |
Description
In a docker run command, you can add multiple IP addresses for a single hostname. In a compose file, you can only set one IP per host.
In a compose file, extra_hosts in long syntax won't pass validation if it sees duplicate keys. Short syntax will allow two hosts with the same IP, but overwrites any previous entries with the last entry for the same hostname.
The text was updated successfully, but these errors were encountered: