Skip to content

Instantly share code, notes, and snippets.

@scyto
Created May 15, 2022 02:05
Show Gist options
  • Save scyto/1091c492fa0c8353be4cbfa3874c7f54 to your computer and use it in GitHub Desktop.
Save scyto/1091c492fa0c8353be4cbfa3874c7f54 to your computer and use it in GitHub Desktop.

Revisions

  1. scyto created this gist May 15, 2022.
    36 changes: 36 additions & 0 deletions swarm-updating-shepherd.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    ## Update Swarm Images ##
    i wanted to update swarm images whenever there is a new image available (even at the risk of breaking something)

    it seems watchtower can't do this for swarm stacks/services - only one off containers.

    I found this great container from https://github.com/djmaze/shepherd

    ### placement considerations

    Must be placed on a manager node.

    ### Config notes
    By default it will refresh all services, exclude any you dont want it to touch.
    I am not using apprise for this yet, but will be implementin apprise soon.


    ```
    version: "3"
    services:
    shepherd:
    build: .
    image: mazzolino/shepherd
    environment:
    - SLEEP_TIME=60m
    - IGNORELIST_SERVICES="shepherd_shepherd wordpress_db wordpress_wordpress"
    - ROLLBACK_ON_FAILURE=true
    - TZ=America/Los_Angeles
    - IMAGE_AUTOCLEAN_LIMIT=2
    # - APPRISE_SIDECAR_URL=apprise-microservice:5000
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    deploy:
    placement:
    constraints:
    - node.role == manager
    ```