Skip to content

Commit

Permalink
fix: Add docker auth (#1432)
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <[email protected]>

Signed-off-by: Ce Gao <[email protected]>
  • Loading branch information
gaocegege authored Jan 20, 2023
1 parent 567004b commit 686d029
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"path/filepath"

"github.com/cockroachdb/errors"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/config"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/session"
Expand Down Expand Up @@ -207,7 +207,8 @@ func (b generalBuilder) build(ctx context.Context, pw progresswriter.Writer) err

for _, entry := range b.entries {
// Set up docker config auth.
attachable := []session.Attachable{authprovider.NewDockerAuthProvider(&configfile.ConfigFile{})}
dockerConfig := config.LoadDefaultConfigFile(os.Stderr)
attachable := []session.Attachable{authprovider.NewDockerAuthProvider(dockerConfig)}
b.logger.WithFields(logrus.Fields{
"type": entry.Type,
}).Debug("build image with buildkit")
Expand Down

0 comments on commit 686d029

Please sign in to comment.