dotcloud/docker — pull request #5063 by vieux (2014-04-08 01:08:40+00:00)
Title: docker rmi -f works with stopped containers + revamped error messages

Fix #5042

** RUNNING CONTAINER **

```
$> docker run -d busybox ping google.com
9c45b46f0aa17ddfabc76c20c9a3b158ad695dbd5df8e12c575c124d5dfda80d
```

if you try to remove `busybox` you'll get
`Error: Conflict, cannot delete 769b9341d937 because the running container 9c45b46f0aa1 is using it (but image was untagged), stop it and use -f to force`

if you use `-f` you'll get
`Error: Conflict, cannot force delete 769b9341d937 because the running container 9c45b46f0aa1 is using it (but image was untagged), stop it and retry`

** STOPPED CONTAINER **

```
$> docker run busybox pwd
/
```

if you try to remove `busybox` you'll get
`Error: Conflict, cannot delete 769b9341d937 because the container 9c45b46f0aa1 is using it (but image was untagged), use -f to force`

if you use `-f` the image will be deleted