mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
bake: support compose inline dockerfile
compose-go v1.13.0 supports the new dockerfile_inline to allow including a dockerfile inline in the compose definition, so we should map this to bake's dockerfile-inline property. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@ -69,6 +69,11 @@ func ParseCompose(cfgs []compose.ConfigFile, envs map[string]string) (*Config, e
|
||||
dockerfilePath := s.Build.Dockerfile
|
||||
dockerfilePathP = &dockerfilePath
|
||||
}
|
||||
var dockerfileInlineP *string
|
||||
if s.Build.DockerfileInline != "" {
|
||||
dockerfileInline := s.Build.DockerfileInline
|
||||
dockerfileInlineP = &dockerfileInline
|
||||
}
|
||||
|
||||
var secrets []string
|
||||
for _, bs := range s.Build.Secrets {
|
||||
@ -88,11 +93,12 @@ func ParseCompose(cfgs []compose.ConfigFile, envs map[string]string) (*Config, e
|
||||
|
||||
g.Targets = append(g.Targets, targetName)
|
||||
t := &Target{
|
||||
Name: targetName,
|
||||
Context: contextPathP,
|
||||
Dockerfile: dockerfilePathP,
|
||||
Tags: s.Build.Tags,
|
||||
Labels: labels,
|
||||
Name: targetName,
|
||||
Context: contextPathP,
|
||||
Dockerfile: dockerfilePathP,
|
||||
DockerfileInline: dockerfileInlineP,
|
||||
Tags: s.Build.Tags,
|
||||
Labels: labels,
|
||||
Args: flatten(s.Build.Args.Resolve(func(val string) (string, bool) {
|
||||
if val, ok := s.Environment[val]; ok && val != nil {
|
||||
return *val, true
|
||||
|
Reference in New Issue
Block a user