From ee23d43ca7127fcaf7f3033dfb32e52139d46473 Mon Sep 17 00:00:00 2001 From: Apoorv Parle <19315187+apparle@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:48:52 -0700 Subject: [PATCH 1/2] Update watchtower to a well-maintained fork and add podman support Signed-off-by: Apoorv Parle <19315187+apparle@users.noreply.github.com> --- Containers/watchtower/Dockerfile | 2 +- Containers/watchtower/start.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Containers/watchtower/Dockerfile b/Containers/watchtower/Dockerfile index 16331f70..173ef09f 100644 --- a/Containers/watchtower/Dockerfile +++ b/Containers/watchtower/Dockerfile @@ -5,7 +5,7 @@ RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache \ build-base; \ - go install github.com/containrrr/watchtower@76f9cea516593fabb8ca91ff13de55caa6aa0a8b; + go install github.com/nicholas-fedor/watchtower@v1.11.3; FROM alpine:3.21.3 diff --git a/Containers/watchtower/start.sh b/Containers/watchtower/start.sh index 2c7a1835..bec4d3a2 100644 --- a/Containers/watchtower/start.sh +++ b/Containers/watchtower/start.sh @@ -9,6 +9,13 @@ elif ! test -r /var/run/docker.sock; then exit 1 fi +if [ -f /run/.containerenv ]; then + # If running under podman disable memory_swappiness setting in watchtower. + # It is a necessary workaround until https://github.com/containers/podman/issues/23824 gets fixed. + echo "Running under Podman. Setting WATCHTOWER_DISABLE_MEMORY_SWAPPINESS to 1." + export WATCHTOWER_DISABLE_MEMORY_SWAPPINESS=1 +fi + if [ -n "$CONTAINER_TO_UPDATE" ]; then exec /watchtower --cleanup --debug --run-once "$CONTAINER_TO_UPDATE" else From eb533eef289c7f7a5de351315c6fa5c33fbfdb20 Mon Sep 17 00:00:00 2001 From: Apoorv Parle <19315187+apparle@users.noreply.github.com> Date: Fri, 13 Jun 2025 05:35:10 -0700 Subject: [PATCH 2/2] Use watchtower image directly instead of building it Signed-off-by: Apoorv Parle <19315187+apparle@users.noreply.github.com> --- Containers/watchtower/Dockerfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Containers/watchtower/Dockerfile b/Containers/watchtower/Dockerfile index 173ef09f..ad4dd4b4 100644 --- a/Containers/watchtower/Dockerfile +++ b/Containers/watchtower/Dockerfile @@ -1,11 +1,5 @@ # syntax=docker/dockerfile:latest -FROM golang:1.24.4-alpine3.21 AS go - -RUN set -ex; \ - apk upgrade --no-cache -a; \ - apk add --no-cache \ - build-base; \ - go install github.com/nicholas-fedor/watchtower@v1.11.3; +FROM ghcr.io/nicholas-fedor/watchtower:1.11.3 AS watchtower FROM alpine:3.21.3 @@ -13,7 +7,7 @@ RUN set -ex; \ apk upgrade --no-cache -a; \ apk add --no-cache bash ca-certificates tzdata -COPY --from=go /go/bin/watchtower /watchtower +COPY --from=watchtower /watchtower /watchtower COPY --chmod=775 start.sh /start.sh