Lifecyclehook post update #1674
Answered
by
piksel
stanthewizzard
asked this question in
Q&A
-
Hello I think I'm using lifecycle hooks wrongly. With docker compose version: '3.8'
services:
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
WATCHTOWER_LIFECYCLE_HOOKS: 'true'
LABEL: com.centurylinklabs.watchtower.lifecycle.post-update="/script/wordpress.sh"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /root/watchtower/script:/script The script apparently is not executed but:
Thanks for help |
Beta Was this translation helpful? Give feedback.
Answered by
piksel
Jun 14, 2023
Replies: 1 comment 1 reply
-
Yes, the lifecycle label goes on the container where you want it to run, so something like: version: '3.8'
services:
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
WATCHTOWER_LIFECYCLE_HOOKS: 'true'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
wordpress:
image: wordpress:latest
container_name: wordpress
labels:
- com.centurylinklabs.watchtower.lifecycle.post-update="/script/wordpress.sh"
volumes:
- /root/watchtower/script:/script |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zoispag
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, the lifecycle label goes on the container where you want it to run, so something like: