diff --git a/pkg/compose/build_bake.go b/pkg/compose/build_bake.go index 83624f3dc..5bed0ba5b 100644 --- a/pkg/compose/build_bake.go +++ b/pkg/compose/build_bake.go @@ -114,6 +114,7 @@ type bakeTarget struct { Ulimits []string `json:"ulimits,omitempty"` Call string `json:"call,omitempty"` Entitlements []string `json:"entitlements,omitempty"` + ExtraHosts map[string]string `json:"extra-hosts,omitempty"` Outputs []string `json:"output,omitempty"` } @@ -223,6 +224,7 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project ShmSize: build.ShmSize, Ulimits: toBakeUlimits(build.Ulimits), Entitlements: entitlements, + ExtraHosts: toBakeExtraHosts(build.ExtraHosts), Outputs: outputs, Call: call, @@ -373,6 +375,14 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project return results, nil } +func toBakeExtraHosts(hosts types.HostsList) map[string]string { + m := make(map[string]string) + for k, v := range hosts { + m[k] = strings.Join(v, ",") + } + return m +} + func additionalContexts(contexts types.Mapping, targets map[string]string) map[string]string { ac := map[string]string{} for k, v := range contexts {