Attached is the unit file (template type) I wrote and that works for me to run multiple instances. It is important to give every instance configuration file a different port number, like

version: 0.1

log:
  fields:
    service: registry

storage:
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/docker-registry/fedora_org
  delete:
    enabled: true

http:
  addr: :5012
  headers:
    X-Content-Type-Options: [nosniff]
  tls:
    minimumtls: tls1.2
    ciphersuites:
      - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
      - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
    certificate: /etc/docker/registry/tls_cert.pem
    key:         /etc/docker/registry/tls_key.pem

proxy:
  remoteurl: https://registry.fedoraproject.org



Of course, you can do it with containers as well. But then the question is, would you want to run debian/ubuntu at all or use some simpler distribution which more or less consists of container starting.

regards

Hadmut


[Unit]
Description=Docker Registry %i
After=network.target

[Service]
User=docker-registry
Type=simple
Environment=REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/var/lib/docker-registry/%i
ExecStartPre=mkdir -p /var/lib/docker-registry/%i
ExecStart=/usr/bin/docker-registry serve /etc/docker/registry/%i.yml

[Install]
WantedBy=multi-user.target

Reply via email to