Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 26b8ef0

Browse files
committed
pass config file to buildkit for authentication
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 184c2b8 commit 26b8ef0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

local/compose/build.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ import (
3030
"github.com/docker/buildx/driver"
3131
_ "github.com/docker/buildx/driver/docker" // required to get default driver registered
3232
"github.com/docker/buildx/util/progress"
33+
cliconfig "github.com/docker/cli/cli/config"
3334
moby "github.com/docker/docker/api/types"
3435
"github.com/docker/docker/errdefs"
3536
bclient "github.com/moby/buildkit/client"
3637
specs "github.com/opencontainers/image-spec/specs-go/v1"
3738

3839
"github.com/docker/compose-cli/api/compose"
40+
"github.com/docker/compose-cli/api/config"
3941
composeprogress "github.com/docker/compose-cli/api/progress"
4042
"github.com/docker/compose-cli/cli/metrics"
4143
"github.com/docker/compose-cli/utils"
@@ -167,7 +169,13 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opts
167169
return nil
168170
}
169171
const drivername = "default"
170-
d, err := driver.GetDriver(ctx, drivername, nil, s.apiClient, nil, nil, nil, "", nil, nil, project.WorkingDir)
172+
173+
configFile, err := cliconfig.Load(config.Dir())
174+
if err != nil {
175+
return err
176+
}
177+
178+
d, err := driver.GetDriver(ctx, drivername, nil, s.apiClient, configFile, nil, nil, "", nil, nil, project.WorkingDir)
171179
if err != nil {
172180
return err
173181
}

0 commit comments

Comments
 (0)