Watchtower - Docker NAS 설정

이미지 예의 @kristsll on Unsplash .

Watchtower는 새 버전이 설정된 Docker 레지스트리에 게시될 때 실행 중인 다른 모든 컨테이너를 업데이트하는 컨테이너입니다. 이는 Docker 컨테이너가 홈 서버 또는 NAS에서 최신 상태를 유지하는 데 유용합니다. NAS를 통하지 않고 홈 서버에 설치하려는 경우 실행 중인 컨테이너 부분으로 이동할 수 있습니다.

전제 조건 📃

  • Enable SSH for your NAS
    • If you don’t have SSH enabled follow this

NAS에 SSH 연결 💻

Now that SSH is enabled on our NAS we need to SSH into the machine so that we can run the docker run command. Open up the terminal on your machine and enter the following:

ssh %USERNAME%@%IP_ADDRESS% -p %PORT%

After you enter in your password you should be greeted with:

%USERNAME%@%SYNOLOGY_NAS_NAME%:~$

컨테이너 실행 🐳

In your terminal enter the following docker run command:

sudo docker run --name="watchtower" -d --restart=always -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower:latest

This will run Watchtower on your NAS allowing it to update existing running images whenever there is a new version pushed! That’s it for the main portion of getting Watchtower up and running. Here a few extra notes since I’ve been running it for a few months:

  • I highly recommend getting Portainer set up to maintain the old images that get replaced, I have a guide on how to set that up .
  • If you want to exclude certain images from being updated you can stop them and rerun them with a label of com.centurylinklabs.watchtower.enable=false

Happy containerization! Cheers! 🍻

좋은 웹페이지 즐겨찾기