Some of my containers can not be restarted by watchtower because of this error:
level=error msg="500 Internal Server Error: cannot mount volume over existing file, file exists /var/lib/docker/aufs/mnt/...
In fact the container setup overwrites existing files in the images by creating one file volumes in docker-compose.yml:
...
volumes:
- '/opt/dockervolumes/wordpress/var_www_html:/var/www/html'
- '/etc/localtime:/etc/localtime'
- '/etc/timezone:/etc/timezone'
But this has never been a problem since I've been using it. docker and docker-compose are able to handle this well.
What's the difference about watchtower? How to fix this?
Thank you very much.
I now even tried to manually start the container by calling the docker api via command line:
echo -e "POST /v1.15/containers/f353778b264d16379018297cb714ae46b1489b9f98e80f321cde4f9fb7c6d199/start HTTP/1.0\r\n" | nc -U /var/run/docker.sock
This works smoothly. What does watchtower do differently? Environment?
In watchtower volumes are created when you create and start container. So I changed this to config.Volumes = map[string]struct{}{} and it worked for me. If you want to test dimag/watchtower.
Same problem here.
Are you still suffering from this problem? I haven't seen this problem so far with actual docker versions.
This is extremely old. Closing this as a lot has happened since. Let me know if the issue persists.
Most helpful comment
I now even tried to manually start the container by calling the docker api via command line:
This works smoothly. What does watchtower do differently? Environment?