New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to remove Docker image: image is referenced in multiple repositories #46
Comments
I think we should ignore the failure to remove Docker images because images can be referenced out of Terraform. |
#104 may solve this issue. |
I think it will partially solve it. Here the case is that the user would like to update the |
This issue is stale because it has been open 60 days with no activity. |
This issue is stale because it has been open 60 days with no activity. |
This is still a problem with 2.15.0. If two containers are spun from the same image, a subsequent run where the image should be updated will stop one container, try to update the image and fail because the other container is still running. This doesn't feel right. If two containers depend on the same image, they should both be destroyed before the image (not familiar with the internals here, but I assume it's a graph of dependencies). |
If I may posit a solution:
A failure to remove the older image at this point may be seen as a Warning, not a Failure, as Terraform has technically completed its proper procedure and updated to the latest available image for all the containers in the list. BTW, this can be easily replicated by doing the following:
If you deploy both those images, when Terraform goes to update mariadb, sometimes it will fail and complain that it can't remove the image. It will also fail to update the image for mariadb_another, leaving your MariaDB instances out of sync. It's never been a big issue for me, because if I get annoyed by it, I just destroy everything and let Terraform rebuild it. |
This issue was originally opened by @stoically as hashicorp/terraform-provider-docker#301. It was migrated here as a result of the community provider takeover from @kreuzwerker. The original body of the issue is below.
Terraform Version
Terraform v0.13.3
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Should always silently upgrade the image / container
Actual Behavior
Error: Unable to remove Docker image: Error response from daemon: conflict: unable to delete 1a3f0281f41e (must be forced) - image is referenced in multiple repositories
Steps to Reproduce
Unfortunately not sure how to reproduce
Notes
Would it be safe to always force-remove images?
The text was updated successfully, but these errors were encountered: