diff --git a/commands.go b/commands.go index 20d6b45c97..0fc1c9a41d 100644 --- a/commands.go +++ b/commands.go @@ -351,7 +351,11 @@ func (srv *Server) CmdRmi(stdin io.ReadCloser, stdout io.Writer, args ...string) return nil } for _, name := range cmd.Args() { - if err := srv.runtime.graph.Delete(name); err != nil { + img, err := srv.runtime.repositories.LookupImage(name) + if err != nil { + return err + } + if err := srv.runtime.graph.Delete(img.Id); err != nil { return err } }