kwk/docker-registry-frontend

Running in Swarm mode: Cannot use secrets

riker09 opened this issue · 0 comments

Expected behavior

  • I want to use the frontend on a Docker Swarm node and manage the certificate details as secrets.

So instead of this:

  frontend:
    image: konradkleine/docker-registry-frontend:v2
    volumes:
      - ./certs/frontend.crt:/etc/apache2/server.crt:ro
      - ./certs/frontend.key:/etc/apache2/server.key:ro

I want to do this:

  frontend:
    image: konradkleine/docker-registry-frontend:v2
    secrets:
      - source: frontend.crt
        target: /etc/apache2/server.crt
        mode: 0440
      - source: frontend.key
        target: /etc/apache2/server.key
        mode: 0440

secrets:
  frontend.crt:
    file: ./certs/frontend.crt
  frontend.key:
    file: ./certs/frontend.key

(I have left out the configs for ports, environment, etc. for brevity)

Actual behavior

  • When using secrets an error is raised during container startup: starting container failed: linux mounts: Duplicate mount point: /etc/apache2/server.crt".

Steps to reproduce the problem

  • Start a registry frontend with the code from the second example above.

Specifications

  • Which version of docker (docker version) are you running?
    Docker version 18.03.1-ce, build 9ee9f40
  • Which operating system do you use?
    Ubuntu 16.04 @ 4.13.0-39-generic
  • Which version of the docker-registry-frontend are you running?
    Git Revision acd3f1f
    konradkleine/docker-registry-frontend v2 60d4b91e68fa 6 months ago 266MB