Update image in Docker?

  • Hi,


    How do you update a container in Docker?
    I have 5 containers, running Jackett, Ombi, OpenHAB, Home Assistant and Organizr.
    If I wish to update a container to the latest version, what is the process? Easiest way to do it without loosing any data?


    Is there any automated process for this?


    Thank you!

  • watchtower is the way to go to automate the process of updating your containers regularly.
    I have mine set up to run every night at 4AM:

    Code
    sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped --name watchtower v2tec/watchtower --rm=true --cleanup --schedule "0 0 4 * * *"


    this thread may help you: Docker Pull+Restart Script [SOLVED]

  • watchtower is the way to go to automate the process of updating your containers regularly.
    I have mine set up to run every night at 4AM:

    Code
    sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped --name watchtower v2tec/watchtower --rm=true --cleanup --schedule "0 4 * * *"

    this thread may help you: Docker Pull+Restart Script [SOLVED]

    Wow, that was a lot harder than I thought it would be. I thought it would be possible by just clicking a button in the plugin.
    Is freenas or v2tec's version the best one?


    I'm not completely sure if I understand how to setup this.

  • If you just want to update a container once you can also just pull the image manually again, then click the "modify" button in the WebUI for the selected container and hit save. This will essentially build the container again with the newer image.


    However for the long run it makes sense to use watchtower, I am using the one from v2tec's repo.

    • Offizieller Beitrag

    If you just want to update a container once you can also just pull the image manually again, then click the "modify" button in the WebUI for the selected container and hit save. This will essentially build the container again with the newer image.

    that’s not correct. The modify button works on current container base image. If you update the image, the old one becomes untagged. Modify will pick from untagged.
    @nicjo814 created it in this way. He must had his reasons


    I have some commits in the plugin to change this. Some sort of enable the image drop down menu in the run container panel. I haven’t yet think about if is a good thing or not.

  • that’s not correct. The modify button works on current container base image. If you update the image, the old one becomes untagged. Modify will pick from untagged.@nicjo814 created it in this way. He must had his reasons


    I have some commits in the plugin to change this. Some sort of enable the image drop down menu in the run container panel. I haven’t yet think about if is a good thing or not.

    okay wow, this is surprising. I used it multiple times in the past (pre-watchtower era) to update my Plex Media Server and the update alert on my devices always went away. Of course a separate GUI button would be much preferred though !

  • This is you’re probably using LSIO image. Which contains plex upgrade on restart of container.


    I have something in mind to solve this. But it won’t be fully automated.

    When can we expect an update for this? I'm not sure I will be able to setup watchtower, and a GUI button for update would be good enough for me!

  • watchtower is the way to go to automate the process of updating your containers regularly.
    I have mine set up to run every night at 4AM:

    Code
    sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped --name watchtower v2tec/watchtower --rm=true --cleanup --schedule "0 0 4 * * *"


    this thread may help you: Docker Pull+Restart Script [SOLVED]

    I just pulled the v2tec/watchtower latest inside the OMV GUI. And after that I tried running this in PuTTy:


    Code
    sudo docker run -d -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped --name watchtower v2tec/watchtower --rm=true --cleanup

    Got this as a result:


    9a88ccff2620abb8070c964bd554a84f4856659ef6d2e1dea78201aa93767484


    And when checking OMV GUI I can see Watchtower being added to Docker Containers, and it is restarting every minute, but the other containers seems unaffected. They are not stopping and updating. Do I have to setup a specific restart policy on all my Containers?
    The line you posted, will it automatically update all your containers?


    I would love some more information!


    EDIT: And if I get it to work, can I add the line above in Scheduled Jobs inside OMV GUI without the last bit (the schedule bit) and schedule it inside the GUI instead?

  • Sorry for the necroposting, but I was looking for a way to automatically update Jackett image without installing watchtower.
    I only need to update Jackett, since sonarr and radarr can auto update themeself.
    There is some script that I can run once in a while to do that? Otherwhise, I don't get how to update an image from the docker webui :(

    Intel G4400 - Asrock H170M Pro4S - 8GB ram - Be Quiet Pure Power 11 400 CM - Nanoxia Deep Silence 4 - 6TB Seagate Ironwolf - RAIDZ1 3x10TB WD - OMV 5 - Proxmox Kernel

  • Ughhhh.....Jacket. That thing is so frequently updated it makes me wonder why.


    What's your objection to using Watchtower to do it?

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Ughhhh.....Jacket. That thing is so frequently updated it makes me wonder why.


    What's your objection to using Watchtower to do it?

    Simply didn't want to install something just to update jackett if I could run a command once a week.
    As you said they update it very often, so I can just update the docker image once for week.


    If it's not possible it's not a big deal, I'll go with watchtower

    Intel G4400 - Asrock H170M Pro4S - 8GB ram - Be Quiet Pure Power 11 400 CM - Nanoxia Deep Silence 4 - 6TB Seagate Ironwolf - RAIDZ1 3x10TB WD - OMV 5 - Proxmox Kernel

  • I don't know how to do it, but it's surely possible, and probably done by someone. I use Watchtower. You can restrict it to only update specific dockers if you don't want to keep them all current.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

Jetzt mitmachen!

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