diff options
author | TomSweeneyRedHat <tsweeney@redhat.com> | 2018-03-20 13:13:09 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-05 15:44:11 +0000 |
commit | 54bd0ae71671084c53bdd7e675e23c657d410280 (patch) | |
tree | 8611cc6e711f9760234669d6a3731aa345f9c18e /cmd/podman/rmi.go | |
parent | fdcf633a33bbbfbc99268965ef5da03a4770619b (diff) | |
download | podman-54bd0ae71671084c53bdd7e675e23c657d410280.tar.gz podman-54bd0ae71671084c53bdd7e675e23c657d410280.tar.bz2 podman-54bd0ae71671084c53bdd7e675e23c657d410280.zip |
Remove image via storage if a buildah container is associated
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Closes: #522
Approved by: mheon
Diffstat (limited to 'cmd/podman/rmi.go')
-rw-r--r-- | cmd/podman/rmi.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/rmi.go b/cmd/podman/rmi.go index 244e07a06..c1be6dabb 100644 --- a/cmd/podman/rmi.go +++ b/cmd/podman/rmi.go @@ -4,6 +4,7 @@ import ( "fmt" "os" + "github.com/containers/storage" "github.com/pkg/errors" "github.com/projectatomic/libpod/libpod/image" "github.com/urfave/cli" @@ -76,6 +77,9 @@ func rmiCmd(c *cli.Context) error { for _, img := range imagesToDelete { msg, err := runtime.RemoveImage(img, c.Bool("force")) if err != nil { + if errors.Cause(err) == storage.ErrImageUsedByContainer { + fmt.Printf("A container associated with containers/storage, i.e. via Buildah, CRI-O, etc., may be associated with this image: %-12.12s\n", img.ID()) + } if lastError != nil { fmt.Fprintln(os.Stderr, lastError) } |