ci: build fix for new buildx

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
This commit is contained in:
Milas Bowman 2023-06-20 15:53:59 -04:00 committed by Nicolas De loof
parent 04aa155878
commit 061b52da9a
2 changed files with 3 additions and 18 deletions

View File

@ -368,8 +368,8 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se
DockerfilePath: dockerFilePath(service.Build.Context, service.Build.Dockerfile),
NamedContexts: toBuildContexts(service.Build.AdditionalContexts),
},
CacheFrom: convertCacheOptions(cacheFrom),
CacheTo: convertCacheOptions(cacheTo),
CacheFrom: pb.CreateCaches(cacheFrom),
CacheTo: pb.CreateCaches(cacheTo),
NoCache: service.Build.NoCache,
Pull: service.Build.Pull,
BuildArgs: buildArgs,
@ -537,18 +537,3 @@ func useDockerDefaultOrServicePlatform(project *types.Project, service types.Ser
}
return plats, nil
}
func convertCacheOptions(in []*pb.CacheOptionsEntry) []bclient.CacheOptionsEntry {
out := make([]bclient.CacheOptionsEntry, len(in))
for i := range in {
attrs := make(map[string]string, len(in[i].Attrs))
for k, v := range in[i].Attrs {
attrs[k] = v
}
out[i] = bclient.CacheOptionsEntry{
Type: in[i].Type,
Attrs: attrs,
}
}
return out
}

View File

@ -386,7 +386,7 @@ func TestBuildPlatformsStandardErrors(t *testing.T) {
res := c.RunDockerComposeCmdNoCheck(t, "--project-directory", "fixtures/build-test/platforms", "build")
res.Assert(t, icmd.Expected{
ExitCode: 17,
Err: `multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")`,
Err: `Multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")`,
})
})