Storj/Watchtower

Hi everyone,

So i have been using storjlabs/watchtower when I first set up storj. I read about it and found out that they kinda created their own version with specific parameters.

Now I would like to use watchtower to update more container, because the storjwatchtower doesn’t. I tried to install the containerrr watchtower but it did not work because there is another one with the name. I know I can change the name.

Should I install another watchtower with different name or I can modify directly the one I have ?

Thank you

It does update several containers if you do not specify any as arguments, or if you explicitly list all needed, i.e.

docker run -d --restart=always --name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
storjlabs/watchtower \
storagenode storagenode2 storagenode3 watchtower \
--stop-timeout 300s

where storagenode storagenode2 storagenode3 watchtower - are names of the containers which you want to update.
If you would not specify any - it will update all running containers, not only Storj’s ones.

You are a genius ! Thank you so much, that’s exactly what I needed !

2 Likes

Hi,

Finally it doesnt seem working. I checked the log and there are errors… But I just copy/paste your code…

Any idea ?
Thank you

2023-02-14T04:10:09.540617940Z stderr Should only be used for testing.
2023-02-14T04:10:09.540580404Z stderr Controls whether watchtower verifies the SMTP server’s certificate chain and host name.
2023-02-14T04:10:09.540489097Z stderr –notification-email-server-tls-skip-verify
2023-02-14T04:10:09.540457696Z stderr –notification-email-server-port int SMTP server port to send notification emails through (default 25)
2023-02-14T04:10:09.540424708Z stderr –notification-email-server-password string SMTP server password for sending notifications
2023-02-14T04:10:09.540383240Z stderr –notification-email-server string SMTP server to send notification emails through
2023-02-14T04:10:09.540348443Z stderr –notification-email-from string Address to send notification emails from
2023-02-14T04:10:09.540318580Z stderr –no-restart do not restart any containers
2023-02-14T04:10:09.540284201Z stderr –no-pull do not pull any new images
2023-02-14T04:10:09.540250201Z stderr -m, --monitor-only Will only monitor for new images, not update the containers
2023-02-14T04:10:09.540208641Z stderr -e, --label-enable watch containers where the com.centurylinklabs.watchtower.enable label is true
2023-02-14T04:10:09.540177536Z stderr -i, --interval int poll interval (in seconds)
2023-02-14T04:10:09.540140918Z stderr -S, --include-stopped Will also include created and exited containers
2023-02-14T04:10:09.540105307Z stderr -H, --host string daemon socket to connect to (default unix:///var/run/docker.sock)
2023-02-14T04:10:09.540072774Z stderr -h, --help help for watchtower
2023-02-14T04:10:09.540038860Z stderr -d, --debug enable debug mode with verbose logging
2023-02-14T04:10:09.540003639Z stderr -c, --cleanup remove previously used images after updating
2023-02-14T04:10:09.539955815Z stderr -a, --api-version string api version to use by docker client (default 1.25)
2023-02-14T04:10:09.539929870Z stderr Flags:
2023-02-14T04:10:09.539904296Z stderr
2023-02-14T04:10:09.539871286Z stderr watchtower [flags]
2023-02-14T04:10:09.539747099Z stderr Usage:
2023-02-14T04:10:09.312599780Z stderr Error: unknown flag: --restart
2023-02-14T04:08:14.938569844Z stderr time=2023-02-14T04:08:14Z level=fatal msg=unknown flag: --restart

I suspect that you mixed some options, so please provide your full docker run command for the watchtower.
Meanwhile please stop and remove the watchtower container and run this command again:

docker run -d --restart=always --name watchtower -v /var/run/docker.sock:/var/run/docker.sock storjlabs/watchtower storagenode storagenode2 storagenode3 watchtower --stop-timeout 300s

I think he didn’t do this:

docker stop -t 300 watchtower
docker rm watchtower

I just copy pasted your previous message…I didnt write anything else.

docker run -d --restart=always --name watchtower
-v /var/run/docker.sock:/var/run/docker.sock
storjlabs/watchtower
storagenode overseerr prowlarr plex portainer sonarr radarr watchtower
–restart=always
–stop-timeout 300s

Im gonna try again

No, you copied something different.
Please compare:

If I get it right, your command should look like:

docker run -d --restart=always --name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
storjlabs/watchtower \
storagenode overseerr prowlarr plex portainer sonarr radarr watchtower \
--stop-timeout 300s

If you want to update all running containers:

docker run -d --restart=always --name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
storjlabs/watchtower \
--stop-timeout 300s

That’s the thing, I don’t want to update my vpn for example. I’m trying to update only these containers.

I wrote this

docker run -d --restart=always --name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
storjlabs/watchtower \
storagenode overseerr prowlarr plex portainer sonarr radarr watchtower \
--stop-timeout 300s

Im gonna check if it’s working.

It’s even worse now.

Maybe it was a bad idea to use watchtower for other container.

If it’s restarting, then you did run it wrong.
Could you please show logs?
And please show your actual docker run command, seems you mixed it with other options/commands.

So I uninstalled the container and reinstalled it with command and it seems it worked.
Before I was doing with task scheduler. I don’t know if it’s related.

Now i have 2 containers that need update. I guess I have to wait 24h for wtachower to update them right ?

Thank you so much Alexey !

1 Like

This is one of the things that’s different in the storj version of watchtower. It checks with a random interval of between 12 and 72 hours. So you may have to wait up to 3 days.

A post was merged into an existing topic: Feb 13, 2023, Ethereum Layer 1, zkSync, and Polygon payouts for the month of January are complete

Do I get this right, that I can use the storj watchtower for not only storj related containers? So I can update every container I add in the prompt? If so, how do I use it in docker compose, to change the containers more easily?

Yes, you get it right with this note:

In the docker-compose.yml file you may specify it like this:

but for port mapping you need to map TCP and UDP ports, i.e.

    ports:
      - 28967:28967/tcp
      - 28967:28967/udp 
      - 14002:14002

and the option

is not needed (the interval is overridden in our version of watchtower).

Hi,

So I got “fancy” and I tried to add more things for watchtower such as

docker run -d --restart=always --name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
storjlabs/watchtower \
storagenode watchtower \
  -e TZ=America/xxxxx \
  -e WATCHTOWER_NOTIFICATIONS=gotify \
  -e WATCHTOWER_NOTIFICATION_GOTIFY_URL="http://xxx.xx.xx.xx:8080/" \
  -e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN="xxxxxxx" \
--schedule '0 0 4 * * *' \
--cleanup \
--stop-timeout 300s

What do I miss ?

thank you,
Pasc

should be before the image name, since these options for docker, not for watchtower, i.e.

docker run -d --restart=always --name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
  -e TZ=America/xxxxx \
  -e WATCHTOWER_NOTIFICATIONS=gotify \
  -e WATCHTOWER_NOTIFICATION_GOTIFY_URL="http://xxx.xx.xx.xx:8080/" \
  -e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN="xxxxxxx" \
storjlabs/watchtower \
storagenode watchtower \
--schedule '0 0 4 * * *' \
--cleanup \
--stop-timeout 300s

However, the option

is almost useless, because the check interval is randomly selected between 12 and 72 hours since start anyway.

Thanks for all Alexey !!! I tried this way, will see what happens in the next 12-72hours. Also yes you re right about the interval, I understand now why it was random :grinning:.
You are really a big help in this forum.

Pasc

1 Like

Hello,

Months passed and I didn’t have time to check more. Still doesn’t work…
I finally learned to use docker compose. Here my config:

version: ‘3.9’
services:
watchtower:
container_name: watchtower
restart: unless-stopped
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_NOTIFICATION=gotify
- WATCHTOWER_NOTIFICATION_GOTIFY_URL=http://ipnas:9295/
- WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN=token
- WATCHTOWER_NOTIFICATION_GOTIFY_TLS_SKIP_VERIFY=true
- WATCHTOWER_LABEL_ENABLE=true
image: storjlabs/watchtower
command: storagenode watchtower --stop-timeout 300s
volumes:
- /var/run/docker.sock:/var/run/docker.sock

gotify:
image: gotify/server
container_name: gotify
restart: unless-stopped
environment:
- GOTIFY_DEFAULTUSER_NAME=admin
- GOTIFY_DEFAULTUSER_PASS=admin
volumes:
- /volume1/docker/gotify/data:/app/data
ports:
- 9295:80

What did I do wrong now. Very hard to set up