add support for extra_hosts building with bake
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
63b06f5563
commit
f599a8cdd2
@ -114,6 +114,7 @@ type bakeTarget struct {
|
|||||||
Ulimits []string `json:"ulimits,omitempty"`
|
Ulimits []string `json:"ulimits,omitempty"`
|
||||||
Call string `json:"call,omitempty"`
|
Call string `json:"call,omitempty"`
|
||||||
Entitlements []string `json:"entitlements,omitempty"`
|
Entitlements []string `json:"entitlements,omitempty"`
|
||||||
|
ExtraHosts map[string]string `json:"extra-hosts,omitempty"`
|
||||||
Outputs []string `json:"output,omitempty"`
|
Outputs []string `json:"output,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,6 +224,7 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
|
|||||||
ShmSize: build.ShmSize,
|
ShmSize: build.ShmSize,
|
||||||
Ulimits: toBakeUlimits(build.Ulimits),
|
Ulimits: toBakeUlimits(build.Ulimits),
|
||||||
Entitlements: entitlements,
|
Entitlements: entitlements,
|
||||||
|
ExtraHosts: toBakeExtraHosts(build.ExtraHosts),
|
||||||
|
|
||||||
Outputs: outputs,
|
Outputs: outputs,
|
||||||
Call: call,
|
Call: call,
|
||||||
@ -373,6 +375,14 @@ func (s *composeService) doBuildBake(ctx context.Context, project *types.Project
|
|||||||
return results, nil
|
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 {
|
func additionalContexts(contexts types.Mapping, targets map[string]string) map[string]string {
|
||||||
ac := map[string]string{}
|
ac := map[string]string{}
|
||||||
for k, v := range contexts {
|
for k, v := range contexts {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user