Skip to content

Commit dff3831

Browse files
committed
chore: add socket-proxy for watchtower
1 parent 70c24a7 commit dff3831

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

Diff for: examples/watchtower/docker-compose.yml

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22

33
watchtower:
4-
image: containrrr/watchtower:latest
4+
image: containrrr/watchtower:latest
55
container_name: watchtower
66
hostname: watchtower
77
environment:
@@ -16,11 +16,38 @@ services:
1616
#- WATCHTOWER_MONITOR_ONLY=true
1717
- WATCHTOWER_SCHEDULE=0 0 6 * * * # requires a go cron syntax of 6 space-separated fields; see https://containrrr.dev/watchtower/arguments/#scheduling
1818
- WATCHTOWER_CLEANUP=true # remove unused images afterwards
19+
- DOCKER_HOST=tcp://socket-proxy:2375 # use socket-proxy for secure docker api access
1920
restart: always
20-
network_mode: "host"
21+
networks:
22+
- watchtower
23+
- proxynet
2124
volumes:
2225
- /etc/localtime:/etc/localtime:ro
23-
- /var/run/docker.sock:/var/run/docker.sock:ro
2426
working_dir: /
2527
labels:
26-
com.centurylinklabs.watchtower: true
28+
com.centurylinklabs.watchtower: true
29+
30+
socket-proxy:
31+
image: lscr.io/linuxserver/socket-proxy:1.26.2
32+
container_name: socket-proxy-watchtower
33+
environment:
34+
- ALLOW_START=1
35+
- ALLOW_STOP=1
36+
- ALLOW_RESTARTS=1
37+
- CONTAINERS=1
38+
- IMAGES=1
39+
- NETWORKS=1
40+
- POST=1
41+
volumes:
42+
- /var/run/docker.sock:/var/run/docker.sock:ro
43+
networks:
44+
- proxynet
45+
restart: always
46+
read_only: true
47+
tmpfs:
48+
- /run
49+
50+
networks:
51+
proxynet:
52+
internal: true
53+
watchtower:

0 commit comments

Comments
 (0)