Schedule Watchtower Docker Cotainer in OMV GUI

  • hello guys, i'd like to run the watchtower docker with some adjustments.
    watchtower should only check for new images all 6 hours and delete the old images afterwards.


    to achieve this, is it correct to add the following line in the extra arguments field in omv/docker GUI?


    Code
    -v /var/run/docker.sock:/var/run/docker.sock v2tec/watchtower --interval 21100 --cleanup

    any feedback or corrections appreciated.
    i just started with docker, so still learning. :rolleyes::saint:

  • I stop it until I decide to start it manually to update containers, once updated is completed I stopt it again.


    And delete of older containers is in my cron (execute once a day o cleanup)

    • Offizieller Beitrag

    thanks for the feedback! :thumbup: you prefer "--cleanup" or a cron job? dont want to get you wrong. :D

    This is the cron job which was posted by another member

    Code
    docker images -q --filter "dangling=true" | xargs -n1 -r docker rmi

    yours looks simpler.....the KISS approach :thumbup: does it work?

  • This is the cron job which was posted by another member

    Code
    docker images -q --filter "dangling=true" | xargs -n1 -r docker rmi

    yours looks simpler.....the KISS approach :thumbup: does it work?

    still have to try it out. at work at the moment.
    will test and report back when i'm at home in the evening. :saint:





    I stop it until I decide to start it manually to update containers, once updated is completed I stopt it again.


    And delete of older containers is in my cron (execute once a day o cleanup)

    thats also a good solution. i thought about schedule it to let watchtower maybe check once a week or something. i dont think more is really necessary.

    • Offizieller Beitrag

    hmm, doesnt seem to work with my command. old images stay there. something must be wrong in it

    :( Ok but what if it was like this



    Code
    -v /var/run/docker.sock:/var/run/docker.sock \
    v2tec/watchtower --cleanup --interval 21100

    so there are 2 separate lines

  • Found the solution under extra arguments there is a an option Command in there you enter --cleanup --interval 21100 then once the container is running under the column Command you get /watchtower --cleanup --interval 21100

    so to be clear, in "Extra arguments" in enter:

    Code
    -v /var/run/docker.sock:/var/run/docker.sock


    and in "container command":

    Code
    --cleanup --interval 21100

    is that correct?

  • :thumbup::thumbup:

    sadly it still doesnt do anything for me :(
    even only with "-v /var/run/docker.sock:/var/run/docker.sock" and without container command it doesnt pull any new images. ?(?(


    Code
    time="2018-12-05T14:04:38+01:00" level=info msg="First run: 2018-12-05 14:09:38 +0100 CET"

    thats everything the log says. looks like the container starts and then doesnt do anything anymore.

    • Offizieller Beitrag

    thats everything the log says. looks like the container starts and then doesnt do anything anymore.

    Mine doesn't do much more, but it does work;


    Code
    time="2018-11-28T14:14:09Z" level=info msg="First run: 2018-11-28 14:19:09 +0000 GMT"
    time="2018-12-03T18:54:10Z" level=info msg="Unable to update container /Emby, err='Error response from daemon: Get https://registry-1.docker.io/v2/emby/embyserver/manifests/latest: EOF'. Proceeding to next."
    time="2018-12-04T10:59:22Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:9dbddc86adcb3f65fad22f5e033036af71aced771bf30f0dc211da5e948865a5)"
    time="2018-12-04T10:59:22Z" level=info msg="Stopping /Heimdall (c70f3aeb86c0fd33fa9f87b9291ee111dbf86b922607b6d85e1b24ddf9c43f7b) with SIGTERM"
    time="2018-12-04T11:02:05Z" level=info msg="Creating /Heimdall"
    time="2018-12-04T11:02:07Z" level=info msg="Removing image sha256:bfbb97bf8b4db55091e4e6d33fcb2729f62b5a90e509debd0617a95c392d1568"
    time="2018-12-04T12:59:16Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:bf397fccda2c84859433da1671e60741a3a0eae8ffa0753192bd82e6aaccd0af)"
    time="2018-12-04T12:59:19Z" level=info msg="Stopping /Heimdall (a0e091d50bb3422a215e1a00f303685bb8d0ba51d2cedc3c5137970b3d03e66d) with SIGTERM"
    time="2018-12-04T12:59:44Z" level=info msg="Creating /Heimdall"
    time="2018-12-04T12:59:46Z" level=info msg="Removing image sha256:9dbddc86adcb3f65fad22f5e033036af71aced771bf30f0dc211da5e948865a5"

    I decided to reinstall my docker completely, I was getting some odd messages in the watchetower log, since then it appears to be better.
    To check that it is running as expected you could run it with the --debug option, but generates all sorts of info in the log, the downside to that I have found you have to stop watchtower, delete then set it up again, but that's painless.
    But as you can see the is does work with --cleanup in the Command option.

  • Mine doesn't do much more, but it does work;

    Code
    time="2018-11-28T14:14:09Z" level=info msg="First run: 2018-11-28 14:19:09 +0000 GMT"
    time="2018-12-03T18:54:10Z" level=info msg="Unable to update container /Emby, err='Error response from daemon: Get https://registry-1.docker.io/v2/emby/embyserver/manifests/latest: EOF'. Proceeding to next."
    time="2018-12-04T10:59:22Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:9dbddc86adcb3f65fad22f5e033036af71aced771bf30f0dc211da5e948865a5)"
    time="2018-12-04T10:59:22Z" level=info msg="Stopping /Heimdall (c70f3aeb86c0fd33fa9f87b9291ee111dbf86b922607b6d85e1b24ddf9c43f7b) with SIGTERM"
    time="2018-12-04T11:02:05Z" level=info msg="Creating /Heimdall"
    time="2018-12-04T11:02:07Z" level=info msg="Removing image sha256:bfbb97bf8b4db55091e4e6d33fcb2729f62b5a90e509debd0617a95c392d1568"
    time="2018-12-04T12:59:16Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:bf397fccda2c84859433da1671e60741a3a0eae8ffa0753192bd82e6aaccd0af)"
    time="2018-12-04T12:59:19Z" level=info msg="Stopping /Heimdall (a0e091d50bb3422a215e1a00f303685bb8d0ba51d2cedc3c5137970b3d03e66d) with SIGTERM"
    time="2018-12-04T12:59:44Z" level=info msg="Creating /Heimdall"
    time="2018-12-04T12:59:46Z" level=info msg="Removing image sha256:9dbddc86adcb3f65fad22f5e033036af71aced771bf30f0dc211da5e948865a5"

    I decided to reinstall my docker completely, I was getting some odd messages in the watchetower log, since then it appears to be better.
    To check that it is running as expected you could run it with the --debug option, but generates all sorts of info in the log, the downside to that I have found you have to stop watchtower, delete then set it up again, but that's painless.
    But as you can see the is does work with --cleanup in the Command option.

    i dont know why, but i added the --debug option and this time it seems to work. it pulled new jdownloader image and created a new container for it.

    but i dont get all the level-info messages you got in your log. only debug messages.
    and what kind of credentials is he asking for in config.json? oO
    anyway, at least its running now. :) but no idea why it didnt run earlier. only thing i changed is the --debug command.

  • Don't know above my pay grade :) have you got the --cleanup command added as well? I know when I enabled debug the log kept filling up.

    so far without cleanup. will have to wait for updated images first. then next time i will try with cleanup and see if it works this time. will report back then. :)
    btw, is it normal that the watchtower container has the status "dead" when i stop it? my other containers like plex and jdownloader have the status "stopped" when i stop them.

  • so far without cleanup. will have to wait for updated images first. then next time i will try with cleanup and see if it works this time. will report back then. :) btw, is it normal that the watchtower container has the status "dead" when i stop it? my other containers like plex and jdownloader have the status "stopped" when i stop them.

    yes, dead is normal.

Jetzt mitmachen!

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