Skip to content

Commit 2fe67a8

Browse files
committed
feat: add basic image build wrapper applying auth
1 parent be3178e commit 2fe67a8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/client/build.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package client
2+
3+
import (
4+
"context"
5+
"github.com/docker/docker/api/types"
6+
"io"
7+
"maps"
8+
)
9+
10+
func (c *Client) ImageBuild(ctx context.Context, buildContext io.Reader, opts types.ImageBuildOptions) (types.ImageBuildResponse, error) {
11+
authConfigs := c.authProvider.AuthConfigs()
12+
maps.Copy(authConfigs, opts.AuthConfigs)
13+
opts.AuthConfigs = authConfigs
14+
15+
return c.Client.ImageBuild(ctx, buildContext, opts)
16+
}

0 commit comments

Comments
 (0)