Source

version: '3.7'

services:
  registry:
    image: registry:2.7
    ports:
      - 5000:5000
    environment:
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry-data
    volumes:
      - /mnt/docker/data/registry/auth:/auth
      - /mnt/docker/data/registry/registry-data:/registry-data