Docker prunes image and networks by itself I have a script which performs backup of several docker volumes during the night.
It starts by stopping the containers that use these volumes, then it creates a new container with all the volumes mounted and back them up with borg. Finally it restarts the containers.
Sometimes the scripts runs into weird issues, like a container can not start because its image or a network it uses is missing. Is it possible that docker daemon prunes them while my backup script is running? How can I disable it?
I could not see anything in daemon logs.
I noticed that you have the docker run command with --rm option. In the Docker docs it says:

If you set the --rm flag, Docker also removes the anonymous volumes associated with the container when the container is removed. This is similar to running docker rm -v my-container

Perhaps this is why the volumes are being deleted?