From ab8fb3876d25efa2196dbea9d6e07e3ea6493c23 Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Tue, 12 Oct 2021 12:41:07 +0530 Subject: builder: Add support for builder prune Docker has support for docker builder prune and docker builder build This patch will add a hidden command to support scripts using this syntax. We don't want to encourage this deviation. Add podman build prune to implement docker builder prune functionality. Co-authored-by: Daniel J Walsh Signed-off-by: Aditya Rajan --- cmd/podman/images/buildx.go | 11 ++++++----- cmd/podman/images/prune.go | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'cmd/podman/images') diff --git a/cmd/podman/images/buildx.go b/cmd/podman/images/buildx.go index 5c8e5aaa0..2577a3a74 100644 --- a/cmd/podman/images/buildx.go +++ b/cmd/podman/images/buildx.go @@ -14,11 +14,12 @@ var ( // If we are adding new buildx features, we will add them by default // to podman build. buildxCmd = &cobra.Command{ - Use: "buildx", - Short: "Build images", - Long: "Build images", - RunE: validate.SubCommandExists, - Hidden: true, + Use: "buildx", + Aliases: []string{"builder"}, + Short: "Build images", + Long: "Build images", + RunE: validate.SubCommandExists, + Hidden: true, } ) diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go index 6c39e5c69..fc7451c41 100644 --- a/cmd/podman/images/prune.go +++ b/cmd/podman/images/prune.go @@ -34,6 +34,11 @@ var ( ) func init() { + registry.Commands = append(registry.Commands, registry.CliCommand{ + Command: pruneCmd, + Parent: buildxCmd, + }) + registry.Commands = append(registry.Commands, registry.CliCommand{ Command: pruneCmd, Parent: imageCmd, -- cgit v1.2.3-54-g00ecf