From 9fefa52b5cc7d1b8a8356d982e7a0532cea3b433 Mon Sep 17 00:00:00 2001 From: Andrej Petras Date: Fri, 2 Feb 2024 23:44:56 +0100 Subject: [PATCH] feat: add buildx push images --- cmd/docker_build.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/docker_build.go b/cmd/docker_build.go index 9dd08a4..4a44c4a 100644 --- a/cmd/docker_build.go +++ b/cmd/docker_build.go @@ -101,6 +101,11 @@ func dockerBuild(project *Project, flags dockerBuildFlags) { // add dockerfile and dockerfile profile command = append(command, "-f", dockerfile) + // push images for buildx + if flags.BuildX && flags.BuildPush { + command = append(command, "--push") + } + // set docker context command = append(command, flags.Context) // execute command @@ -108,7 +113,8 @@ func dockerBuild(project *Project, flags dockerBuildFlags) { log.Info("Docker build done!", log.Fields{"image": dockerImage, "tags": tags}) - if flags.BuildPush { + // for none buildx we need to push it manually + if !flags.BuildX && flags.BuildPush { dockerImagePush(dockerImage, tags, flags.Docker.Project.SkipPush) } }