summaryrefslogtreecommitdiffstats
path: root/content/posts/updating-docker-containers.md
diff options
context:
space:
mode:
authorbreadcat2023-03-15 17:25:25 +0000
committerbreadcat2023-03-15 17:25:25 +0000
commita8c9215f6d1e5376e97069d7561e002ebc6720b8 (patch)
tree9025fb50e28a95238ea38dd354f4ffdf4e3a8459 /content/posts/updating-docker-containers.md
parent7019da06d7638892f7308a55902ad5fb359e0cc4 (diff)
downloadblog.minskio.co.uk-a8c9215f6d1e5376e97069d7561e002ebc6720b8.tar.gz
blog.minskio.co.uk-a8c9215f6d1e5376e97069d7561e002ebc6720b8.tar.bz2
blog.minskio.co.uk-a8c9215f6d1e5376e97069d7561e002ebc6720b8.zip
New posts
Huh, I never commit these eh?
Diffstat (limited to 'content/posts/updating-docker-containers.md')
-rw-r--r--content/posts/updating-docker-containers.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/content/posts/updating-docker-containers.md b/content/posts/updating-docker-containers.md
new file mode 100644
index 0000000..e0f9767
--- /dev/null
+++ b/content/posts/updating-docker-containers.md
@@ -0,0 +1,31 @@
+---
+title: "Upgrading docker containers"
+date: 2023-02-14T22:35:00
+lastmod: 2023-03-15T17:22:00
+tags: ["Docker", "Guides", "Linux", "Servers", "Software"]
+---
+
+I moved all my server infrastructure some ~8 months ago to a simpler arm64 stack hosted on Oracles free tier. As part of this (and to reduce some headaches) I purposely chose not to constantly update my docker containers. The amount of times things would mess up, versus get fixed was just not worth the hassle. Eventually though, you do need to update things which brings me to todays post.
+
+We're going to be using [watchtower](https://containrrr.dev/watchtower/) for everything here, it's multi-arch, comes as a docker container and will gracefully handle environmental variables which I'm using in my stack. We're exposing `docker.sock` so just be aware of the litany of security issues this could entail.
+
+First we'll list out what can be updated:
+```
+docker run -it -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --monitor-only --run-once
+```
+
+If you're only after updating a few containers, you can [read up on the arguments](https://containrrr.dev/watchtower/arguments/) for narrowing the scope of updates.
+We're a bit reckless though (and made plenty of backups) so we're updating everything all at once:
+```
+docker run -it -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once
+```
+
+After you've updated everything, you can remove any old and unused containers with:
+```
+docker image prune -f
+docker system prune -af
+```
+
+...now if you'll excuse me, I need to go read through my [updating postgres blog post](/upgrading-postgresql-in-an-alpine-docker-container/) again...
+
+* **Edit 2023-03-15:** Improved empty directory deletion section \ No newline at end of file