summaryrefslogtreecommitdiff
path: root/cmd/podman/images/build.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-08-04 14:59:44 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-08-09 13:05:49 -0400
commit170fb257295027aeb6410b86e06c38086299d2e3 (patch)
tree4f21e0320895a90cdb78df27beb97dcf16bfcb53 /cmd/podman/images/build.go
parent04ab2b16617fe2d3178eb0b461aacbcab609611e (diff)
downloadpodman-170fb257295027aeb6410b86e06c38086299d2e3.tar.gz
podman-170fb257295027aeb6410b86e06c38086299d2e3.tar.bz2
podman-170fb257295027aeb6410b86e06c38086299d2e3.zip
Alias build to buildx, so it won't fail
Add hidden --load and --progress flag as well. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images/build.go')
-rw-r--r--cmd/podman/images/build.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 3aeba6fb0..a1a28b809 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -67,6 +67,18 @@ var (
podman image build --layers --force-rm --tag imageName .`,
}
+ buildxBuildCmd = &cobra.Command{
+ Args: buildCmd.Args,
+ Use: buildCmd.Use,
+ Short: buildCmd.Short,
+ Long: buildCmd.Long,
+ RunE: buildCmd.RunE,
+ ValidArgsFunction: buildCmd.ValidArgsFunction,
+ Example: `podman buildx build .
+ podman buildx build --creds=username:password -t imageName -f Containerfile.simple .
+ podman buildx build --layers --force-rm --tag imageName .`,
+ }
+
buildOpts = buildFlagsWrapper{}
)
@@ -91,11 +103,24 @@ func init() {
Parent: imageCmd,
})
buildFlags(imageBuildCmd)
+ registry.Commands = append(registry.Commands, registry.CliCommand{
+ Command: buildxBuildCmd,
+ Parent: buildxCmd,
+ })
+ buildFlags(buildxBuildCmd)
}
func buildFlags(cmd *cobra.Command) {
flags := cmd.Flags()
+ // buildx build --load ignored, but added for compliance
+ flags.Bool("load", false, "buildx --load")
+ _ = flags.MarkHidden("load")
+
+ // buildx build --progress ignored, but added for compliance
+ flags.String("progress", "auto", "buildx --progress")
+ _ = flags.MarkHidden("progress")
+
// Podman flags
flags.BoolVarP(&buildOpts.SquashAll, "squash-all", "", false, "Squash all layers into a single layer")