How To Update Docker Container automatically with nearly zero downtime

  Рет қаралды 80,275

Christian Lempa

Christian Lempa

Күн бұрын

How to update docker container automatically with Watchtower. Scheduled updates without downtime for your entire docker environment. #Docker #HomeLab #Watchtower
DOCS: github.com/christianlempa/vid...
Portainer tutorial: • Portainer Install Ubun...
Watchtower documentation: containrrr.dev/watchtower/
Follow me:
TWITTER: / christianlempa
INSTAGRAM: / christianlempa
DISCORD: / discord
GITHUB: github.com/christianlempa
PATREON: / christianlempa
MY EQUIPMENT: kit.co/christianlempa
Timestamps:
00:00 - Introduction
02:00 - Install Watchtower on a docker server
04:37 - How to exclude specific containers
06:31 - Scheduling and cleanup
09:11 - Deploy in portainer
----
All links with "*" are affiliate links.

Пікірлер: 77
@jacowaes
@jacowaes Жыл бұрын
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 6 ай бұрын
great idea. How can this be done?
@grimm_
@grimm_ Жыл бұрын
I absolutely love your channel and especially how you provide writeups in addition to your videos. Great stuff man
@christianlempa
@christianlempa Жыл бұрын
Thank you so much 😊
@raymondfb
@raymondfb Жыл бұрын
Thank you for taking the time to make this video.
@msteven2
@msteven2 2 жыл бұрын
Superb video - thank you! Just the help I needed with my docker server!
@christianlempa
@christianlempa 2 жыл бұрын
Thank you :)
@chrisumali9841
@chrisumali9841 2 жыл бұрын
Thanks for the demo and info, have a great day
@christianlempa
@christianlempa 2 жыл бұрын
Thank you so much :D
@garypaulson5202
@garypaulson5202 2 жыл бұрын
Thank you, this was very useful
@fauzifirdaus8200
@fauzifirdaus8200 3 жыл бұрын
Thank you!! your video is very helpful
@christianlempa
@christianlempa 3 жыл бұрын
Thank you bro 😊
@rhb.digital
@rhb.digital Жыл бұрын
great video.. appreciated
@KPunkt-wf9xd
@KPunkt-wf9xd 3 жыл бұрын
Super Video. Thank you!
@christianlempa
@christianlempa 3 жыл бұрын
Thanks 😊
@Chris-B-Chicken
@Chris-B-Chicken Жыл бұрын
Super cool - wusste nicht das es sowas wie watchtower gibt - danke!
@gavinskurrie
@gavinskurrie 4 ай бұрын
Bit late to this video but BRILLIANT! Thanks and hello from Melbourne Aus!!
@christianlempa
@christianlempa 4 ай бұрын
Thanks for watching!
@Myektaie
@Myektaie Жыл бұрын
Nice! Thanks ❤
@christianlempa
@christianlempa Жыл бұрын
You’re welcome ☺️
@ronald0122
@ronald0122 3 жыл бұрын
thanks
@derwintromp1461
@derwintromp1461 7 ай бұрын
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 KZfaq
@VisakhVspm
@VisakhVspm 3 жыл бұрын
How to handle data volume for example in case of postgres
@majorgear1021
@majorgear1021 Ай бұрын
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!
@huwjones3241
@huwjones3241 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 2 жыл бұрын
Thanks! You can add a label to the container you want to exclude "com.centurylinklabs.watchtower.enable="false""
@rezaz8238
@rezaz8238 Жыл бұрын
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 10 ай бұрын
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
@chriskeo392
@chriskeo392 Жыл бұрын
Python module Pywin32 doesn't work. Isn't docker supposed to avoid dependency issues?
@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 Жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
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 :)
@MohdFhazal
@MohdFhazal 4 ай бұрын
hye can u teach us how to setup a websocket server on docker?
@farenhe1t
@farenhe1t 3 жыл бұрын
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 жыл бұрын
Hey, you simply append a -d in the parameters, then it runs persistently in the background.
@markokraljevic1590
@markokraljevic1590 2 жыл бұрын
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 2 жыл бұрын
That would be a better topic for Ci/CD than watchtower actually.
@andresvela5316
@andresvela5316 2 жыл бұрын
What about if the docker image is already in the Azure Container Registry? How can you make this update?
@christianlempa
@christianlempa 2 жыл бұрын
You can customize the registry, watchtower will always try to pull the latest image version.
@JuanaMeloUnicEducation
@JuanaMeloUnicEducation 3 жыл бұрын
great video, do you know if this watchtower image works with ARM architecture (raspberry Pi 4)
@JuanaMeloUnicEducation
@JuanaMeloUnicEducation 3 жыл бұрын
never mind I found it containrrr/watchtower:armhf-
@christianlempa
@christianlempa 3 жыл бұрын
that was fast ;) thanks for mentioning!
@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
@christianlempa
@christianlempa Жыл бұрын
Thx for sharing!
@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 жыл бұрын
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
@Doowi92
@Doowi92 Жыл бұрын
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 Жыл бұрын
There is a section in the official docs about private registries, maybe that helps
@Doowi92
@Doowi92 Жыл бұрын
@@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 Жыл бұрын
@@Doowi92 maybe you should join our discord, share some details about your error message and setup, we might be able to help you
@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
@DC-xt1ry
@DC-xt1ry 11 ай бұрын
I used to run a chrono job instead lol
@jamescoulter9659
@jamescoulter9659 3 жыл бұрын
😎
@VedantiUjawane
@VedantiUjawane 2 жыл бұрын
How to exclude my Nextcloud from watchtower to be auto updated?
@m0rthaus
@m0rthaus 2 жыл бұрын
You can exclude individual containers by adding a special label to your container. LABEL com.centurylinklabs.watchtower.monitor-only="true"
@-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
@audujoel1736
@audujoel1736 9 ай бұрын
Lex luthor teaching us coding, Nice
@notreallyme425
@notreallyme425 2 жыл бұрын
Will Watchtower update itself?
@christianlempa
@christianlempa 2 жыл бұрын
I think it does
@rahulshah1408
@rahulshah1408 Жыл бұрын
Thanks! Please enjoy a beverage as a thank you.
@christianlempa
@christianlempa Жыл бұрын
Thank you so much 😊
@yukanolive4727
@yukanolive4727 3 жыл бұрын
Article Not found ooops :)
@christianlempa
@christianlempa 3 жыл бұрын
thanks for mentioning, updated it :)
@beardedjer
@beardedjer 26 күн бұрын
info for germans: you have to subtract two hours to get the german time
@markcuello5
@markcuello5 Жыл бұрын
HELP
@MrNoBSgiven
@MrNoBSgiven 2 жыл бұрын
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 2 жыл бұрын
I'm not sure what you're talking about?
@MrNoBSgiven
@MrNoBSgiven 2 жыл бұрын
@@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 2 жыл бұрын
Ah that makes sense 😁 np bro!
@NaserAlOqab
@NaserAlOqab 7 ай бұрын
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 Жыл бұрын
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 * * *
@tcasex
@tcasex 8 ай бұрын
thank you!
Docker explained simply
18:47
Christian Lempa
Рет қаралды 33 М.
Docker Networking Tutorial, ALL Network Types explained!
19:46
Christian Lempa
Рет қаралды 192 М.
1,000 Diamonds! (Funny Minecraft Animation) #shorts #cartoon
00:31
toonz CRAFT
Рет қаралды 41 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 112 МЛН
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 44 МЛН
Stop, Intel’s Already Dead!
13:47
Linus Tech Tips
Рет қаралды 276 М.
Automatic Container Updates - Watchtower Docker GitOps
12:40
98% Cloud Cost Saved By Writing Our Own Database
21:45
ThePrimeTime
Рет қаралды 341 М.
Automate your Docker deployments with Ansible
20:32
Christian Lempa
Рет қаралды 90 М.
You should NOT use Cloudflare Tunnel (if you do this...)
10:07
Christian Lempa
Рет қаралды 241 М.
you need to learn Docker RIGHT NOW!! // Docker Containers 101
23:19
NetworkChuck
Рет қаралды 2,6 МЛН
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 430 М.
Manage all your SSH servers with teleport
33:28
Christian Lempa
Рет қаралды 75 М.
Quick and Easy Local SSL Certificates for Your Homelab!
12:08
Wolfgang's Channel
Рет қаралды 733 М.