Skip to content

Instantly share code, notes, and snippets.

@ualter
Last active October 18, 2019 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ualter/52ef5d1762abbda4752d0c44eb2fabd9 to your computer and use it in GitHub Desktop.
Save ualter/52ef5d1762abbda4752d0c44eb2fabd9 to your computer and use it in GitHub Desktop.
Docker Compose for Docker Local Registry (My-Registry)
version: '3.3'
services:
registry:
image: registry:2
restart: always
ports:
- "5000"
environment:
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
REGISTRY_HTTP_ADDR: 0.0.0.0:5000
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
REGISTRY_HTTP_TLS_KEY: /certs/domain.key
## In case the Images being stored at AWS S3
#REGISTRY_STORAGE: s3
#REGISTRY_STORAGE_S3_ACCESSKEY: <api access key>
#REGISTRY_STORAGE_S3_SECRETKEY: <api secret>
#REGISTRY_STORAGE_S3_BUCKET: <bucket name>
#REGISTRY_STORAGE_S3_REGION: <region>
#REGISTRY_HEALTH_STORAGEDRIVER_ENABLED: false
## HTTP Basic Authentication for Registry Access
REGISTRY_AUTH: 'htpasswd'
REGISTRY_AUTH_HTPASSWD_REALM: 'docker-ualter'
REGISTRY_AUTH_HTPASSWD_PATH: '/httpasswd_storage/htpasswd'
ports:
- "5000:5000"
volumes:
- ${MY_REGISTRY_CERTS}:/certs
- ${REGISTRY_AUTH_PATH}:/httpasswd_storage
registry-frontend:
image: konradkleine/docker-registry-frontend:v2
restart: always
environment:
ENV_DOCKER_REGISTRY_HOST: 'registry'
ENV_DOCKER_REGISTRY_PORT: 5000
links:
- registry
ports:
- "8080:80"
expose:
- 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment