pascal
February 11, 2023, 11:54pm
1
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
Alexey
February 12, 2023, 4:00am
2
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.
pascal
February 12, 2023, 1:01pm
3
You are a genius ! Thank you so much, that’s exactly what I needed !
2 Likes
pascal
February 14, 2023, 4:38am
4
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
Alexey
February 14, 2023, 5:11am
5
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
snorkel
February 14, 2023, 8:09pm
6
I think he didn’t do this:
docker stop -t 300 watchtower
docker rm watchtower
pascal
February 15, 2023, 2:52am
7
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
Alexey
February 15, 2023, 3:13am
8
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
pascal
February 15, 2023, 3:24am
9
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.
pascal
February 15, 2023, 4:24am
10
pascal:
--stop-timeout 300s
It’s even worse now.
Maybe it was a bad idea to use watchtower for other container.
Alexey
February 15, 2023, 4:36am
11
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.
pascal
February 15, 2023, 9:15pm
12
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.
Alexey
Split this topic
February 16, 2023, 3:17am
14
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?
Alexey
February 17, 2023, 4:14am
16
Yes, you get it right with this note:
In the docker-compose.yml
file you may specify it like this:
For the ones looking for a docker-compose.yml file:
version: "3.3"
services:
<containername>:
image: storjlabs/storagenode:latest
container_name: <containername>
volumes:
- type: bind
source: <"/Path/to/identity/files">
target: /app/identity
- type: bind
source: <"/Path/to/Data/storage/location">
target: /app/config
ports:
- 28967:28967
- 14002:14002
restart: unless-stopped
stop_grace_period: 300s
environment…
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).
pascal
May 11, 2023, 2:51am
17
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
Alexey
May 11, 2023, 3:23am
18
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.
pascal
May 12, 2023, 3:16am
19
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 .
You are really a big help in this forum.
Pasc
1 Like
pascal
November 18, 2023, 6:45pm
20
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