Skip to content

Lifecyclehook post update #1674

Answered by piksel
stanthewizzard asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stanthewizzard
Comment options

Answer selected by zoispag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants