Skip to content

Instantly share code, notes, and snippets.

@leanderjanssen
Last active September 4, 2024 04:13
Show Gist options
  • Save leanderjanssen/0e5532dc5818ab84b54b06cf80ad93ed to your computer and use it in GitHub Desktop.
Save leanderjanssen/0e5532dc5818ab84b54b06cf80ad93ed to your computer and use it in GitHub Desktop.
Docker Registry with Minio storage example

Running a docker registry with Minio S3 backend

Run minio in a container

docker run -d -p 9000:9000 --name minio minio/minio server /export

Use docker logs to retrieve access key and secret key from minio container

docker logs minio

Create config.yml for Docker Registry

This file will have to be mounted to /etc/docker/registry/config.yml

version: 0.1
log:
  level: debug
  formatter: text
  fields:
    service: registry
    environment: staging
loglevel: debug
storage:
  s3:
    accesskey: <minio access key>
    secretkey: <minio secret key>
    region: us-east-1
    regionendpoint: http://<docker host ip running minio>:9000
    # Make sure you've created the following bucket.
    bucket: docker
    encrypt: false
    keyid: mykeyid
    secure: true
    v4auth: true
    chunksize: 5242880
    rootdirectory: /
  delete:
    enabled: true
  maintenance:
    uploadpurging:
      enabled: true
      age: 168h
      interval: 24h
      dryrun: false
    readonly:
      enabled: false
http:
  addr: :5000
  tls:
      certificate: /certs/domain.crt
      key: /certs/domain.key

Run Docker registry in a container

docker run -d -p 5000:5000 \
  -v $(pwd)/config.yml:/etc/docker/registry/config.yml \
  -v $(pwd)/certs:/certs \
  --name=registry registry:2

Tag some image to push to the registry

docker tag alpine:3.5 <docker host ip running registry>:5000/alpine:3.5 docker push <docker host ip running registry>:5000/alpine:3.5

@blee1
Copy link

blee1 commented Oct 17, 2020

Have you experienced and performance issues with the minio backend when:
maintenance: uploadpurging: enabled: true age: 168h interval: 24h dryrun: false

is turned on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment