Schedule Watchtower Docker Cotainer in OMV GUI

    • OMV 4.x
    • 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?

      Source Code

      1. -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:
      ODROID HC2
    • 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)
      OMV 4.1.11 x64 on a HP T510, 16GB CF as Boot Disk & 32GB SSD 2,5" disk for Data, 4 GB RAM, CPU VIA EDEN X2 U4200 is x64 at 1GHz

      Post: HPT510 SlimNAS ; HOWTO Install Pi-Hole ; HOWTO install MLDonkey ; HOHTO Install ZFS-Plugin ; OMV_OldGUI ; ShellinaBOX ;
      Dockers: MLDonkey ; PiHole ; weTTY
      Videos: @TechnoDadLife
    • MarcTremonti wrote:

      geaves wrote:

      Well it looks Ok, I would prefer to run that than a cron job for clean up....you could run it and report back :thumbup:
      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

      Source Code

      1. docker images -q --filter "dangling=true" | xargs -n1 -r docker rmi
      yours looks simpler.....the KISS approach :thumbup: does it work?
      Raid is not a backup! Would you go skydiving without a parachute?
    • geaves wrote:

      MarcTremonti wrote:

      geaves wrote:

      Well it looks Ok, I would prefer to run that than a cron job for clean up....you could run it and report back :thumbup:
      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

      Source Code

      1. 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:




      raulfg3 wrote:

      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.
      ODROID HC2
    • geaves wrote:

      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:

      Source Code

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

      and in "container command":

      Source Code

      1. --cleanup --interval 21100
      is that correct?
      ODROID HC2
    • New

      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. ?( ?(

      Source Code

      1. 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.
      ODROID HC2

      The post was edited 1 time, last by MarcTremonti ().

    • New

      MarcTremonti wrote:

      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;

      Source Code

      1. time="2018-11-28T14:14:09Z" level=info msg="First run: 2018-11-28 14:19:09 +0000 GMT"
      2. 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."
      3. time="2018-12-04T10:59:22Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:9dbddc86adcb3f65fad22f5e033036af71aced771bf30f0dc211da5e948865a5)"
      4. time="2018-12-04T10:59:22Z" level=info msg="Stopping /Heimdall (c70f3aeb86c0fd33fa9f87b9291ee111dbf86b922607b6d85e1b24ddf9c43f7b) with SIGTERM"
      5. time="2018-12-04T11:02:05Z" level=info msg="Creating /Heimdall"
      6. time="2018-12-04T11:02:07Z" level=info msg="Removing image sha256:bfbb97bf8b4db55091e4e6d33fcb2729f62b5a90e509debd0617a95c392d1568"
      7. time="2018-12-04T12:59:16Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:bf397fccda2c84859433da1671e60741a3a0eae8ffa0753192bd82e6aaccd0af)"
      8. time="2018-12-04T12:59:19Z" level=info msg="Stopping /Heimdall (a0e091d50bb3422a215e1a00f303685bb8d0ba51d2cedc3c5137970b3d03e66d) with SIGTERM"
      9. time="2018-12-04T12:59:44Z" level=info msg="Creating /Heimdall"
      10. 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.
      Raid is not a backup! Would you go skydiving without a parachute?
    • New

      geaves wrote:

      MarcTremonti wrote:

      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;

      Source Code

      1. time="2018-11-28T14:14:09Z" level=info msg="First run: 2018-11-28 14:19:09 +0000 GMT"
      2. 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."
      3. time="2018-12-04T10:59:22Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:9dbddc86adcb3f65fad22f5e033036af71aced771bf30f0dc211da5e948865a5)"
      4. time="2018-12-04T10:59:22Z" level=info msg="Stopping /Heimdall (c70f3aeb86c0fd33fa9f87b9291ee111dbf86b922607b6d85e1b24ddf9c43f7b) with SIGTERM"
      5. time="2018-12-04T11:02:05Z" level=info msg="Creating /Heimdall"
      6. time="2018-12-04T11:02:07Z" level=info msg="Removing image sha256:bfbb97bf8b4db55091e4e6d33fcb2729f62b5a90e509debd0617a95c392d1568"
      7. time="2018-12-04T12:59:16Z" level=info msg="Found new linuxserver/heimdall:latest image (sha256:bf397fccda2c84859433da1671e60741a3a0eae8ffa0753192bd82e6aaccd0af)"
      8. time="2018-12-04T12:59:19Z" level=info msg="Stopping /Heimdall (a0e091d50bb3422a215e1a00f303685bb8d0ba51d2cedc3c5137970b3d03e66d) with SIGTERM"
      9. time="2018-12-04T12:59:44Z" level=info msg="Creating /Heimdall"
      10. 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.

      Source Code

      1. time="2018-12-06T15:12:44+01:00" level=debug msg="Retrieving running containers"
      2. time="2018-12-06T15:12:44+01:00" level=info msg="First run: 2018-12-06 15:17:44 +0100 CET"
      3. time="2018-12-06T15:17:44+01:00" level=debug msg="Checking containers for updated images"
      4. time="2018-12-06T15:17:44+01:00" level=debug msg="Retrieving running containers"
      5. time="2018-12-06T15:17:44+01:00" level=debug msg="Pulling v2tec/watchtower:armhf-latest for /cranky_jones"
      6. time="2018-12-06T15:17:44+01:00" level=debug msg="No credentials for v2tec in /config.json"
      7. time="2018-12-06T15:17:44+01:00" level=debug msg="No authentication credentials found for v2tec/watchtower:armhf-latest"
      8. time="2018-12-06T15:17:45+01:00" level=debug msg="No new images found for /cranky_jones"
      9. time="2018-12-06T15:17:45+01:00" level=debug msg="Pulling lsioarmhf/plex:latest for /Plexmediaserver"
      10. time="2018-12-06T15:17:45+01:00" level=debug msg="No credentials for lsioarmhf in /config.json"
      11. time="2018-12-06T15:17:45+01:00" level=debug msg="No authentication credentials found for lsioarmhf/plex:latest"
      12. time="2018-12-06T15:17:46+01:00" level=debug msg="No new images found for /Plexmediaserver"
      13. time="2018-12-06T15:17:46+01:00" level=debug msg="Pulling jaymoulin/jdownloader:latest for /jdownloader"
      14. time="2018-12-06T15:17:46+01:00" level=debug msg="No credentials for jaymoulin in /config.json"
      15. time="2018-12-06T15:17:46+01:00" level=debug msg="No authentication credentials found for jaymoulin/jdownloader:latest"
      16. time="2018-12-06T15:18:02+01:00" level=info msg="Found new jaymoulin/jdownloader:latest image (sha256:c25e336eb651600bf100a52f8e6cf40b129277ac6f5614abc4c3f0141300a49e)"
      17. time="2018-12-06T15:18:02+01:00" level=info msg="Stopping /jdownloader (3e0a69631f6e34479499d2192034cf568eb623d06c96c7adeb632d03f4344170) with SIGTERM"
      18. time="2018-12-06T15:18:12+01:00" level=debug msg="Removing container 3e0a69631f6e34479499d2192034cf568eb623d06c96c7adeb632d03f4344170"
      19. time="2018-12-06T15:18:13+01:00" level=info msg="Creating /jdownloader"
      20. time="2018-12-06T15:18:14+01:00" level=debug msg="Starting container /jdownloader (1b5b428db141d8dbc2058f2e010da68be9b6c5b30f48e9934150eab1ddc95edd)"
      21. time="2018-12-06T15:18:15+01:00" level=debug msg="Scheduled next run: 2018-12-06 15:22:44 +0100 CET"
      Display All
      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.
      ODROID HC2

      The post was edited 3 times, last by MarcTremonti ().

    • New

      geaves wrote:

      MarcTremonti wrote:

      and what kind of credentials is he asking for in config.json? oO
      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.
      ODROID HC2
    • New

      MarcTremonti wrote:

      geaves wrote:

      MarcTremonti wrote:

      and what kind of credentials is he asking for in config.json? oO
      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.
      yes, dead is normal.
      Images
      • 1.jpg

        66.93 kB, 532×699, viewed 1 times
      OMV 4.1.11 x64 on a HP T510, 16GB CF as Boot Disk & 32GB SSD 2,5" disk for Data, 4 GB RAM, CPU VIA EDEN X2 U4200 is x64 at 1GHz

      Post: HPT510 SlimNAS ; HOWTO Install Pi-Hole ; HOWTO install MLDonkey ; HOHTO Install ZFS-Plugin ; OMV_OldGUI ; ShellinaBOX ;
      Dockers: MLDonkey ; PiHole ; weTTY
      Videos: @TechnoDadLife