kereis / traefik-certs-dumper

Dumps Let's Encrypt certificates of a specified domain which Traefik stores in acme.json.
Apache License 2.0
129 stars 24 forks source link

unexpected volume #194

Open tomelgato opened 2 months ago

tomelgato commented 2 months ago

Im a little bit puzzled, could be an error on my side, im docker newbie:

I use this docker compose configuration with Traefik 3x and Mailcow, works fine:

    certdumper:
      image: ghcr.io/kereis/traefik-certs-dumper
      command: --restart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
      network_mode: none
      volumes:
          # Mount the volume which contains Traefik's `acme.json' file
          #   Configure the external name in the volume definition
        - acme:/traefik:ro
          # Mount mailcow's SSL folder
        - ./data/assets/ssl/:/output:rw
          # Mount docker socket to restart containers
        - /var/run/docker.sock:/var/run/docker.sock:ro
      restart: always
      environment:
          # only change this, if you're using another domain for mailcow's web frontend compared to the standard config
        - DOMAIN=${MAILCOW_HOSTNAME}

volumes:
  acme:
    external: true
    # Name of the external docker volume which contains Traefik's `acme.json' file
    name: traefik_acme

The thing which puzzles me, im always getting a unnamed volume when certdumper runs, which gets abandoned after every restart:

# docker container inspect  -f '{{ range .Mounts }}{{ .Name }}:{{ .Destination }} {{ end }}'  260f7a6a611e

:/output :/var/run/docker.sock traefik_acme:/traefik d31e21dba89964178c9fe031131c15469ccec6a3a8d25764d1ddf9ce78e01a9a:/var/lib/docker

Where is the volume linked to /var/lib/docker coming from?

Thanks for this nice little piece of sw!

kereis commented 4 weeks ago

Hi @tomelgato,

sorry for the late response, it got lost in notifications and I didn't really pick up the time to take a look.

The Docker image uses docker:25.0.3 as base image, which in turn automatically creates a volume via VOLUME /var/lib/docker (e. g. https://github.com/docker-library/docker/blob/master/27/dind/Dockerfile#L104). So it looks like that VOLUME statements are propagated to this image here. I don't know if I can do anything about that.

I hope that answer your question. :)