(CTTC) Fix Docker image cleanup in CI/CD pipeline
Reporters
- Lluis Gifre (CTTC)
Description
Fix Docker image cleanup in CI/CD pipeline. Using command docker images --filter="dangling=true" --quiet | xargs -r docker rmi, in some cases dangling images are not properly removed. Command docker image prune --force instead works fine.
Deployment environment
CI/CD pipeline
TFS deployment settings
CI/CD pipeline
Sequence of actions that resulted in the bug
CI/CD pipeline
Document the explicit error
$ docker images --filter="dangling=true" --quiet | xargs -r docker rmi
Untagged: labs.etsi.org:5050/tfs/controller/mock_tfs_nbi_dependencies@sha256:735ede67ab50e70c240eaea5c9ba7e889edd9b82f2a9d49ab7aa0f484c3d64f2
Deleted: sha256:dc99a79c53e098e95fdb2cf69851126d04cc7cb644ababb55fd66e091810af48
Error response from daemon: conflict: unable to delete 2b814b72acba (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete 2b814b72acba (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete bd4f9c35728b (must be forced) - image is referenced in multiple repositories
Error response from daemon: conflict: unable to delete bd4f9c35728b (must be forced) - image is referenced in multiple repositories
Expected behaviour
CI/CD to pass properly
References
None
Edited by Lluis Gifre Renom