summaryrefslogtreecommitdiff
path: root/cmd/podman/images/untag.go
blob: 3218844b79651bb90209cc7d22805ffc4b855712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package images

import (
	"github.com/containers/libpod/cmd/podman/registry"
	"github.com/containers/libpod/pkg/domain/entities"
	"github.com/spf13/cobra"
)

var (
	untagCommand = &cobra.Command{
		Use:   "untag [flags] IMAGE [NAME...]",
		Short: "Remove a name from a local image",
		Long:  "Removes one or more names from a locally-stored image.",
		RunE:  untag,
		Args:  cobra.MinimumNArgs(1),
		Example: `podman untag 0e3bbc2
  podman untag imageID:latest otherImageName:latest
  podman untag httpd myregistryhost:5000/fedora/httpd:v2`,
	}
)

func init() {
	registry.Commands = append(registry.Commands, registry.CliCommand{
		Mode:    []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
		Command: untagCommand,
	})
}

func untag(cmd *cobra.Command, args []string) error {
	return registry.ImageEngine().Untag(registry.GetContext(), args[0], args[1:], entities.ImageUntagOptions{})
}