mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #25051 from dmcgowan/fix-untag-without-force-while-container-running
Fix untag without force while container running
This commit is contained in:
commit
bad654b00c
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ func (daemon *Daemon) ImageDelete(imageRef string, force, prune bool) ([]types.I
|
||||||
// first. We can only remove this reference if either force is
|
// first. We can only remove this reference if either force is
|
||||||
// true, there are multiple repository references to this
|
// true, there are multiple repository references to this
|
||||||
// image, or there are no containers using the given reference.
|
// image, or there are no containers using the given reference.
|
||||||
if !(force || len(repoRefs) > 1) {
|
if !force && isSingleReference(repoRefs) {
|
||||||
if container := daemon.getContainerUsingImage(imgID); container != nil {
|
if container := daemon.getContainerUsingImage(imgID); container != nil {
|
||||||
// If we removed the repository reference then
|
// If we removed the repository reference then
|
||||||
// this image would remain "dangling" and since
|
// this image would remain "dangling" and since
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue