How To Update Docker Container automatically with nearly zero downtime

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 78

  • @jacowaes
    @jacowaes ปีที่แล้ว +22

    An idea for a related topic. Use the pre-update hooks to make a backup of the container volumes before an upgrade of the container. Because often a new version has code running that alters the data and there is no downgrade possible. Hooks to automatically make backups right before a container image upgrade is an nice addition to a regular backup schedule.

    • @fabioamado6725
      @fabioamado6725 11 หลายเดือนก่อน

      great idea. How can this be done?

    • @l4rkdono
      @l4rkdono หลายเดือนก่อน

      just do snapshots bro

  • @grimm_
    @grimm_ ปีที่แล้ว +4

    I absolutely love your channel and especially how you provide writeups in addition to your videos. Great stuff man

  • @msteven2
    @msteven2 2 ปีที่แล้ว +2

    Superb video - thank you! Just the help I needed with my docker server!

  • @raymondfb
    @raymondfb ปีที่แล้ว

    Thank you for taking the time to make this video.

  • @chrisumali9841
    @chrisumali9841 3 ปีที่แล้ว +1

    Thanks for the demo and info, have a great day

  • @farenhe1t
    @farenhe1t 3 ปีที่แล้ว +1

    At 08:44, you run the command to schedule Watchtower, but it sits running (probably until it runs). How can you run that command so it drops back to the prompt, but is still scheduled? Thanks!

    • @christianlempa
      @christianlempa  3 ปีที่แล้ว +4

      Hey, you simply append a -d in the parameters, then it runs persistently in the background.

  • @VisakhVspm
    @VisakhVspm 3 ปีที่แล้ว +1

    How to handle data volume for example in case of postgres

  • @FhazalFPV
    @FhazalFPV 20 วันที่ผ่านมา

    it's delete azuracast auto updater, how can i fix this ?

  • @derwintromp1461
    @derwintromp1461 ปีที่แล้ว +1

    Are there any other tutorial that dives a bit deeper into how to configure, for example if you have to let watchtower watch multiple stack in portainer that are from different registry with different access token? All these tutorial seem to be very identical to other tutorials on TH-cam

  • @gavskuzz
    @gavskuzz 9 หลายเดือนก่อน

    Bit late to this video but BRILLIANT! Thanks and hello from Melbourne Aus!!

    • @christianlempa
      @christianlempa  9 หลายเดือนก่อน

      Thanks for watching!

  • @rezaz8238
    @rezaz8238 2 ปีที่แล้ว +1

    Thanks for your great videos... I have one question. In 4:55 you said that if we specify a version tag, Watchtower does not update the image. Isn't that wrong? If that is right, then Watchtower almost has no use, because we barely use latest tag in production.

    • @loganthrockmorton8179
      @loganthrockmorton8179 ปีที่แล้ว +1

      What would Watchtower update the container to if you've specified a specific version? The whole point of the version number is to keep it a that version if the image ever needs re-pulled

  • @garypaulson5202
    @garypaulson5202 2 ปีที่แล้ว +1

    Thank you, this was very useful

  • @Chris-B-Chicken
    @Chris-B-Chicken 2 ปีที่แล้ว

    Super cool - wusste nicht das es sowas wie watchtower gibt - danke!

  • @chriskeo392
    @chriskeo392 2 ปีที่แล้ว

    Python module Pywin32 doesn't work. Isn't docker supposed to avoid dependency issues?

  • @pecasuy
    @pecasuy ปีที่แล้ว

    Excuse my ignorance, you have to indicate a restart value, or the service having the scheduled schedule, it will execute itself, I ask if there is a docker restart, thanks

  • @huwjones3241
    @huwjones3241 3 ปีที่แล้ว +2

    Hi there, great video, how would you add an exception to a docker-compose file? For example, I want to deploy Watchtower out but want to avoid it updating my PiHole.

    • @christianlempa
      @christianlempa  3 ปีที่แล้ว +3

      Thanks! You can add a label to the container you want to exclude "com.centurylinklabs.watchtower.enable="false""

  • @KPunkt-wf9xd
    @KPunkt-wf9xd 4 ปีที่แล้ว +1

    Super Video.
    Thank you!

  • @Doowi92
    @Doowi92 2 ปีที่แล้ว

    Hi, im facing a issue to make watchtower work with my private repository on docker hub it can't authentify... someone has a idea how to make it work with your private repository ?
    thank you!

    • @christianlempa
      @christianlempa  2 ปีที่แล้ว

      There is a section in the official docs about private registries, maybe that helps

    • @Doowi92
      @Doowi92 2 ปีที่แล้ว

      @@christianlempa Hi, thank you for your answer ! i already check that but i could not be able to connect it to my private repository :'( i must have done it not well

    • @christianlempa
      @christianlempa  2 ปีที่แล้ว

      @@Doowi92 maybe you should join our discord, share some details about your error message and setup, we might be able to help you

  • @MohdFhazal
    @MohdFhazal 10 หลายเดือนก่อน

    hye can u teach us how to setup a websocket server on docker?

  • @majorgear1021
    @majorgear1021 6 หลายเดือนก่อน

    I’m surprised that you weren’t using gitops to configure and deploy containers!
    Good video though. I’m in the planning phase of deploying watchtower so I’m learning what configuration options are.
    I already started writing the github workflow flow to deploy it , but I’m far from committing and pushing that file to github!

  • @fauzifirdaus8200
    @fauzifirdaus8200 3 ปีที่แล้ว +1

    Thank you!! your video is very helpful

  • @markokraljevic1590
    @markokraljevic1590 3 ปีที่แล้ว

    how to have watchtower listen for a signal after successful docker image build in github actions and try to update image then and not just randomly on a cron?

    • @christianlempa
      @christianlempa  3 ปีที่แล้ว +1

      That would be a better topic for Ci/CD than watchtower actually.

  • @TheRealAnthony_real
    @TheRealAnthony_real 2 ปีที่แล้ว

    What about if you have docker-compose ? Everyone you restart the docker compose if not edited with lastest versions it will revert to what the version in docker compose is ?

    • @christianlempa
      @christianlempa  2 ปีที่แล้ว +1

      That shouldn't make a difference. When you're using the :latest tag it should work the same for compose files as well. If you tagged a specific version, it won't be updated

    • @AlexChama
      @AlexChama 2 ปีที่แล้ว

      @@christianlempa Does updating through Watchtower retain the full control by Portainer though? I'm hesitant to let it just go ham on my images and then find out that suddenly my stacks are decoupled or however you might call it.

    • @m0rthaus
      @m0rthaus 2 ปีที่แล้ว

      @@AlexChama What many people do is set Watchtower to 'monitor only' mode and then it can email you when updates are available to your containers, and then you can manually action them as desired. For example if there's an upgrade to a new major version for a specific app you may want to run it manually as it has specific steps to follow post-update, like with Nextcloud.
      The variable to set Watchtower to monitor only mode in your docker compose file is:
      - WATCHTOWER_MONITOR_ONLY=true

  • @andresvela5316
    @andresvela5316 3 ปีที่แล้ว

    What about if the docker image is already in the Azure Container Registry? How can you make this update?

    • @christianlempa
      @christianlempa  3 ปีที่แล้ว

      You can customize the registry, watchtower will always try to pull the latest image version.

  • @rhb.digital
    @rhb.digital 2 ปีที่แล้ว

    great video.. appreciated

  • @rahulshah1408
    @rahulshah1408 ปีที่แล้ว

    Thanks! Please enjoy a beverage as a thank you.

  • @Myektaie
    @Myektaie 2 ปีที่แล้ว

    Nice! Thanks ❤

  • @modo4211
    @modo4211 2 ปีที่แล้ว

    First of all thanks for the helpful video.
    How do I handle container updates?
    I don't mean updating the base image when it changes, but applying regular security updates with apt. What in case of automatic security updates?
    Set up unattended-upgrades in each Docker container with appropriate update interval or automatically rebuild the image if Dockerfile contains a "RUN apt update && apt upgrade -y" statement or even include unattended-updates as RUN command in Dockerfile and rebuild the image each time?
    I'm wondering why I can't find many resources on this topic because it's so important. Can you (and/or someone) please cover this question?

    • @fredrik354
      @fredrik354 2 ปีที่แล้ว +1

      I'm no expert but if I'm honest I've never heard of someone running package updates in a running container. You usually do it when building the image. From my point of view, that's like asking for annoying things to break that you probably won't be able to fix until the builder of the image releases an update - depending on the application/your knowledge. If you're building your images yourself and keep track of all dependencies then it's no biggie of course.

  • @roya2045
    @roya2045 4 ปีที่แล้ว

    Hi Bro can you make a video on ansible playbook writing pattern in yaml. I have seen lot of videos but they don't explain the pattern there are lot of long spaces in the starting of sentences then there are hyphens in the sentences that too are starting from odd lines hence its getting confusing and difficult to understand not sure if it has a standard pattern/format. can you kindly explain this in the video i am not from a coding or a devops background

    • @christianlempa
      @christianlempa  4 ปีที่แล้ว

      I need to have a look at this, but yea I'm working to extend my ansible boilerplates that are on my Github page. So you might want to take a look at :)

  • @VedantiUjawane
    @VedantiUjawane 2 ปีที่แล้ว

    How to exclude my Nextcloud from watchtower to be auto updated?

    • @m0rthaus
      @m0rthaus 2 ปีที่แล้ว +2

      You can exclude individual containers by adding a special label to your container.
      LABEL com.centurylinklabs.watchtower.monitor-only="true"

  • @JuanaHMelo
    @JuanaHMelo 4 ปีที่แล้ว +3

    great video, do you know if this watchtower image works with ARM architecture (raspberry Pi 4)

    • @JuanaHMelo
      @JuanaHMelo 4 ปีที่แล้ว +3

      never mind I found it containrrr/watchtower:armhf-

    • @christianlempa
      @christianlempa  4 ปีที่แล้ว

      that was fast ;) thanks for mentioning!

  • @ronald0122
    @ronald0122 4 ปีที่แล้ว

    thanks

  • @-a6833
    @-a6833 2 ปีที่แล้ว

    Hey mate did your twitch channel get deleted?

    • @christianlempa
      @christianlempa  2 ปีที่แล้ว

      Hey, no I changed the name, as I'm mainly planning to do german content only there

  • @notreallyme425
    @notreallyme425 2 ปีที่แล้ว

    Will Watchtower update itself?

  • @yukanolive4727
    @yukanolive4727 4 ปีที่แล้ว

    Article Not found ooops :)

    • @christianlempa
      @christianlempa  4 ปีที่แล้ว +1

      thanks for mentioning, updated it :)

  • @user-he8qc4mr4i
    @user-he8qc4mr4i ปีที่แล้ว

    I used to run a chrono job instead lol

  • @marcello4258
    @marcello4258 ปีที่แล้ว

    As I don’t like running container especially not from 3rd party with host root privileges due to security reasons I guess I will just do cron jobs

  • @markcuello5
    @markcuello5 ปีที่แล้ว

    HELP

  • @beardedjer
    @beardedjer 6 หลายเดือนก่อน

    info for germans: you have to subtract two hours to get the german time

  • @tgdb-ace
    @tgdb-ace ปีที่แล้ว

    Lex luthor teaching us coding, Nice

  • @jamescoulter9659
    @jamescoulter9659 3 ปีที่แล้ว

    😎

  • @MrNoBSgiven
    @MrNoBSgiven 3 ปีที่แล้ว

    You should consider legal actions as your termination was clearly wrong. If people like you don't take stand, now do you expect regukar folks to do it? Suing the department and the state has nothing with not respecting people who fight fire. They also are being victimized.

    • @christianlempa
      @christianlempa  3 ปีที่แล้ว

      I'm not sure what you're talking about?

    • @MrNoBSgiven
      @MrNoBSgiven 3 ปีที่แล้ว

      @@christianlempa sorry for that. The comment was aimed for some othe video, and the youtube client somehow got confused and attached it to yours. Again, I appologize.

    • @christianlempa
      @christianlempa  3 ปีที่แล้ว

      Ah that makes sense 😁 np bro!

  • @NaserAlOqab
    @NaserAlOqab ปีที่แล้ว

    I use this docker compose oneliner to update Portainer, even while the container is up:
    docker compose -f prod.yml up portainer --pull --build -d

  • @mandarihno3463
    @mandarihno3463 2 ปีที่แล้ว +1

    version: "3"
    services:
    watchtower:
    image: containrrr/watchtower
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    environment:
    - TZ=America/New_York
    - WATCHTOWER_CLEANUP=true
    - WATCHTOWER_SCHEDULE=0 0 4 * * *