Reputation: 15076
I have a jenkins job which executes a shell script. The last step of the shell script is deleting the docker images which are on the server (except the images which are in use). This is my command:
set +x
docker rmi `docker images -aq`
output:
Error response from daemon: conflict: unable to delete 69a777edb6dc (must be forced) - image is referenced in one or more repositories
Error response from daemon: conflict: unable to delete 69a777edb6dc (must be forced) - image is referenced in one or more repositories
Error response from daemon: conflict: unable to delete d9d7acd2e160 (cannot be forced) - image is being used by running container 4e5ba6ffeaf0
How am I able to ignore the errors (because it's normal) + hiding the output of the command? (tried set +x but did not help)
Upvotes: 2
Views: 2549
Reputation: 6458
It should be:
docker 2>/dev/null rmi
docker images -aq
| true
(only one pipe line)
Upvotes: 1