Skip to content

Commit

Permalink
common attrs for tar export (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin authored Jun 23, 2023
1 parent 52b76cd commit 2056bdb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docker/buildkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func BuildDockerImageWithBuildKit(

eg, ctx := errgroup.WithContext(ctx)

attrs := map[string]string{
"name": strings.Join(tags, ","),
}

exports := make([]client.ExportEntry, 1)

if tarExport != "" {
Expand All @@ -77,7 +81,8 @@ func BuildDockerImageWithBuildKit(
}

exports[0] = client.ExportEntry{
Type: "docker",
Type: "docker",
Attrs: attrs,
Output: func(m map[string]string) (io.WriteCloser, error) {
f, err := os.Create(tarExport)
if err != nil {
Expand All @@ -89,10 +94,8 @@ func BuildDockerImageWithBuildKit(
}
} else {
export := client.ExportEntry{
Type: "image",
Attrs: map[string]string{
"name": strings.Join(tags, ","),
},
Type: "image",
Attrs: attrs,
}
if push {
export.Attrs["push"] = "true"
Expand Down

0 comments on commit 2056bdb

Please sign in to comment.