Skip to content

Commit

Permalink
Fix to include output to an image even if this is not default.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolftimmermans committed Nov 13, 2024
1 parent e6b7020 commit 2e25307
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.5.1

* Fix `kd build` to include output to an image even if this is not default.

# v2.5.0

* Automatically use remote cache for builds if supported by the builder (requires containerd).
Expand Down
5 changes: 3 additions & 2 deletions pkg/build/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Run(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) error
currentBranch, err := util.GetCurrentBranch(log, app.Path)
if err != nil {
log.Warn("Could not determine current branch:", err)
buildCacheTag = "unknown"
} else {
buildCacheTag = currentBranch
}
Expand All @@ -40,7 +41,7 @@ func Run(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) error
log.Fatal(err)
}

log.Note("Pushing", app.Name+":"+app.Tag)
log.Note("Pushing to", app.Repository())
if err := docker.Push(log, app); err != nil {
log.Fatal(err)
}
Expand All @@ -52,6 +53,6 @@ func Run(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) error
}
}

log.Success("Successfully built", app.Repository())
log.Success("Successfully built", app.Name+":"+app.Tag)
return nil
}
1 change: 1 addition & 0 deletions pkg/internal/docker/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func Build(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) erro

return util.Run(log,
"docker", append(cmd,
"--output=type=image",
"--file", dockerfile,
"--tag", app.Repository(),
"--platform", app.Platform,
Expand Down

0 comments on commit 2e25307

Please sign in to comment.