diff --git a/CHANGELOG.md b/CHANGELOG.md index 3005fe69..5455d694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.5.4 + +* Combine build and push in a single step. + # v2.5.3 * Increase compatibility with older docker clients. diff --git a/pkg/build/cmd.go b/pkg/build/cmd.go index e45d951e..abccf243 100644 --- a/pkg/build/cmd.go +++ b/pkg/build/cmd.go @@ -41,10 +41,7 @@ func Run(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) error log.Fatal(err) } - log.Note("Pushing to", app.Repository()) - if err := docker.Push(log, app); err != nil { - log.Fatal(err) - } + log.Note("Pushed to", app.Repository()) if app.PostBuild != "" { err := util.Run(log, "sh", "-c", app.PostBuild) diff --git a/pkg/internal/docker/cli.go b/pkg/internal/docker/cli.go index 5e6a3eef..7435189d 100644 --- a/pkg/internal/docker/cli.go +++ b/pkg/internal/docker/cli.go @@ -59,7 +59,7 @@ func Build(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) erro return util.Run(log, "docker", append(cmd, - "--output=type=image", + "--output=type=image,name="+app.Repository()+",push=true", "--file", dockerfile, "--tag", app.Repository(), "--platform", app.Platform, @@ -67,13 +67,6 @@ func Build(log *util.Logger, app *config.ResolvedApp, buildCacheTag string) erro )...) } -func Push(log *util.Logger, app *config.ResolvedApp) error { - return util.Run(log, - "docker", - "push", app.Repository(), - ) -} - func supportsCacheExport(log *util.Logger) bool { output, err := util.Capture(log, "docker", "buildx", "inspect", "--debug") if err != nil {