Clean shutdown DOCKER containers before reboot or shutdown OMV

  • Hi, first of all, sorry for my spelling, i'm from Argentina.


    I have a jdownloader Docker container and at least 2 times i lost my settings. I think is because the container just get killed when i shutdown or restart OMV and that corrupted my files.


    Is there a way to tell docker to do a clean shutdown of the containers (and OMV wait for it) every time a shutdown or reboot OMV?



    Thnaks in advance

    • Offizieller Beitrag

    You can stop docker


    systemctl stop docker


    Then run dockerd -D



    After it goes stable you can press ctrl+c


    and you will see how docker terminates all containers, the same happens on shutdown via systemd. In general docker tries to stop, if that doesn't happen in the first 10 seconds it will forcibly kill it.


    I cannot find any information in the documentation on how to extend the stop time wait, or change the termination signal for a container when docker daemon is stopped


    docker run provides:


    --stop-signal string Signal to stop a container (default "SIGTERM")
    --stop-timeout int Timeout (in seconds) to stop a container

  • Is there a way to do this automatically without having to login via shell every-time I want to reboot/shutdown OMV? I've had a couple of times where my docker containers are in a dead state after stopping/starting my box.


    I would have thought OMV would be doing a graceful shutdown of docker then itself before power-off? Looks like it is not the case.

    • Offizieller Beitrag

    Is there a way to do this automatically without having to login via shell every-time I want to reboot/shutdown OMV? I've had a couple of times where my docker containers are in a dead state after stopping/starting my box.

    What exactly are you referring to?

    I would have thought OMV would be doing a graceful shutdown of docker then itself before power-off? Looks like it is not the case.

    Why do you blame omv? docker gets stopped in the same way i described above by systemd unit which is provided by docker

  • What exactly are you referring to?

    When shutting down or rebooting OMV, when OMV comes back up - it looks like my docker containers are in a dead state. If I stop each container and then shutdown/reboot OMV - the containers are ok. I assumed OMV wasn't doing a clean shutdown of docker before shutdown.


    Why do you blame omv? docker gets stopped in the same way i described above by systemd unit which is provided by docker

    Sorry i'm not trying to blame anyone/thing here - I assumed it was OMV, maybe its docker - i'm not sure. Just looking for help to resolve it and if anyone else has experienced the issue.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!