-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
I used 'docker rmi -f' in a script and expected it to behave like rm 's -f: If the container (or file) does not exist, still exit cleanly. For another example, mkdir -p is handy in shell scripts to idempotently make a directory tree whether or not it already exists, avoiding additional code to handle such cases.
For example:
$ docker rmi -f non-existant-image
Error response from daemon: No such image: non-existant-image:latest
$ echo $?
1
$ rm -f non-existant-file
$ echo $?
0I'm not sure about the scope of this request (perhaps it also applies to docker rm), or the validity, but I did hear at Dockercon that you were interested in improving the developer experience no matter how small - and this would improve mine a little bit. Otherwise, I need to run "docker rmi -f imagename || true", or wrap it in a second docker call to make it conditional.
farrellit, allencloud, JanDeDobbeleer and ndbroadbent
Metadata
Metadata
Assignees
Labels
No labels