I’m running a Docker container like so:
#!/bin/sh exec docker run --name oops-it-leaks-memory \ --log-driver gelf --log-opt gelf-address=udp://... \ --dns ... -v ... -e ... \ --restart on-failure \ oops-it-leaks-memory
The single process in the container has some sort of memory leak in it that I haven’t diagnosed, and eventually the kernel OOM killer takes down that process. When it does, the restart policy doesn’t seem to apply. Any hints?
[If I was going to guess at something, it would be that, when the container exited, in spite of the restart policy, the
docker run command exited too, and if I said
docker run -d --restart on-failure it would work? I’d find that slightly surprising though.]