Conversation
50e957c to
5370096
Compare
bake/bake.go
Outdated
There was a problem hiding this comment.
I opted for extra-hosts instead of add-hosts in Bake. Compose has also the same name.
tests/bake.go
Outdated
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
| Ulimits []string `json:"ulimits,omitempty" hcl:"ulimits,optional" cty:"ulimits"` | ||
| Call *string `json:"call,omitempty" hcl:"call,optional" cty:"call"` | ||
| Entitlements []string `json:"entitlements,omitempty" hcl:"entitlements,optional" cty:"entitlements"` | ||
| ExtraHosts map[string]*string `json:"extra-hosts,omitempty" hcl:"extra-hosts,optional" cty:"extra-hosts"` |
There was a problem hiding this comment.
a single host name can actually have multiple IPs assigned (typically, to support IPv4 and IPv6)
For this purpose, Compose's HostsList is a map[string][]string. Maybe simpler to keep using a plain []string to mimic --add-host build flag
There was a problem hiding this comment.
Ah indeed this would not work with current logic. I guess with map[string]*string it would be smth like myhost = "8.8.8.8,::1" to have both v4/v6 ?
On LLB side I don't think we support that format though 🤔
There was a problem hiding this comment.
Better align with LLB model then, to avoid yet another undocumented format that will require additional parsing.
IMHO []string is fine as an API, as this naturally matches with --add-host on the CLI
jsternberg
left a comment
There was a problem hiding this comment.
PR looks good but I don't have an opinion on the multiple IP thing.
|
Let's check the multiple-ip case for rc2. |
|
@tonistiigi doing so, there's a risk json model changes, isn't it? => compatibility break with Docker Compose to generate bake.json |
fixes #494