watchtower가 에러났다
November 14, 2025

도커는 의존성에 신경 안써도 되서 편하지만 대신 apt가 아니다보니 이미지 업데이트를 직접 관리해야 하더라.
nginx 같은 서비스는 보안 업데이트를 꾸준히 챙겨줘야 하는데 그럼 docker-compose.yml이 있는 곳에 가서 일일히 docker compose pull 해야했다.
근데 중요 업데이트가 자주 뜨는것도 아닌데 신경써서 수동으로 체크하는건 좀 아닌거 같아 watchtower도 도커에 올려 자동화했다.
근데 이번에 docker ps를 해보니 watchtower 컨테이너가 계속 restarting 되고 있는거다.
로그를 확인해보니 이런 이유로 반복되고 있었다.
pitoche@blog:~$ docker logs watchtower
...
time="2025-11-12T19:45:42Z" level=error msg="Error response from daemon: client version 1.25 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version"
time="2025-11-12T19:45:42Z" level=info msg="Waiting for the notification goroutine to finish" notify=no
도커 클라이언트 버전이 너무 낡아서 지원을 안한다고?
저 시간대 로그를 찾아보니 원인을 찾았다.
pitoche@blog:~$ grep -R "docker" /var/log/apt/history.log*
/var/log/apt/history.log-Start-Date: 2025-11-11 18:47:28
/var/log/apt/history.log-Commandline: apt upgrade
/var/log/apt/history.log-Requested-By: pitoche (1000)
/var/log/apt/history.log:Upgrade: containerd.io:amd64 (1.7.29-1~ubuntu.24.04~noble, 2.1.5-1~ubuntu.24.04~noble), docker-ce-cli:amd64 (5:28.5.2-1~ubuntu.24.04~noble, 5:29.0.0-1~ubuntu.24.04~noble), docker-ce:amd64 (5:28.5.2-1~ubuntu.24.04~noble, 5:29.0.0-1~ubuntu.24.04~noble), docker-ce-rootless-extras:amd64 (5:28.5.2-1~ubuntu.24.04~noble, 5:29.0.0-1~ubuntu.24.04~noble), intel-microcode:amd64 (3.20250512.0ubuntu0.24.04.1, 3.20250812.0ubuntu0.24.04.1)
/var/log/apt/history.log-End-Date: 2025-11-11 18:47:44
그러고 보니 저 시간에 apt update 하면서 --upgradable 체크해보니 오랜만에 메이저 업데이트 떴다고 반가워 했던것 같기도 하고. 그동안 업그레이드를 하면서 한번도 충돌난적이 없어서 설마 기존 컨테이너에 영향을 줄 줄은 몰랐고 watchtower가 여기서 걸린거였다.
음…
watchtower가 잠시 죽은건 괜찮다. 중요한 기능도 아니고 도커 허브에 최신 이미지 교체될때까지 컨테이너를 내려놓고 방치해도 된다.
근데 컨테이너에 unless-stopped 옵션을 줘놓고 27시간동안 계속 restarting 되고있던걸 눈치 못챈건 좀 충격이었다.
그래서 주기적으로 도커 상태를 체크하고 restarting이 5회 이상 반복되면 텔레그램으로 알림을 보내게 추가로 쉘 스크립트를 작성했다. 텔레그램 봇 만드는건 아주 쉽더라.

테스트 결과 잘 작동한다(\n은 고쳐야겠다). 이제 문제가 발생해도 조금 안심이다.