Skip to content

Commit

Permalink
feat: add buildx push images
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Feb 2, 2024
1 parent 047bc3d commit 9fefa52
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/docker_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,20 @@ 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
tools.ExecCmd("docker", command...)

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)
}
}

0 comments on commit 9fefa52

Please sign in to comment.