From 26b8ef0f498c6c3fafbab4e6fc2b8ada3222d915 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 12 Apr 2021 15:58:26 +0200 Subject: [PATCH] pass config file to buildkit for authentication Signed-off-by: Nicolas De Loof --- local/compose/build.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/local/compose/build.go b/local/compose/build.go index d2f3d138a..8b93aa9c6 100644 --- a/local/compose/build.go +++ b/local/compose/build.go @@ -30,12 +30,14 @@ import ( "github.com/docker/buildx/driver" _ "github.com/docker/buildx/driver/docker" // required to get default driver registered "github.com/docker/buildx/util/progress" + cliconfig "github.com/docker/cli/cli/config" moby "github.com/docker/docker/api/types" "github.com/docker/docker/errdefs" bclient "github.com/moby/buildkit/client" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/docker/compose-cli/api/compose" + "github.com/docker/compose-cli/api/config" composeprogress "github.com/docker/compose-cli/api/progress" "github.com/docker/compose-cli/cli/metrics" "github.com/docker/compose-cli/utils" @@ -167,7 +169,13 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts return nil } const drivername = "default" - d, err := driver.GetDriver(ctx, drivername, nil, s.apiClient, nil, nil, nil, "", nil, nil, project.WorkingDir) + + configFile, err := cliconfig.Load(config.Dir()) + if err != nil { + return err + } + + d, err := driver.GetDriver(ctx, drivername, nil, s.apiClient, configFile, nil, nil, "", nil, nil, project.WorkingDir) if err != nil { return err }