Skip to content

Setting up a private Docker registry through MinIO object repository

Notifications You must be signed in to change notification settings

SiNa88/docker-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

Private Docker registry

Setting up a private Docker registry on a MinIO object repository

Running a docker registry with Minio S3 backend

Create config.yml for Docker Registry

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

version: 0.1
log:
  level: info
  formatter: text
  fields:
    service: docker-reg
    environment: production
loglevel: debug
storage:
  s3:
    accesskey: <minio access key>
    secretkey: <minio secret key>
    region: eu-south-1
    regionendpoint: https://<docker host ip running registry>:9000/
    secure: true
    bucket: docker-registry
    encrypt: false
    v4auth: true
    chunksize: 5242880
    rootdirectory: /
  delete:
    enabled: true
  maintenance:
    uploadpurging:
      enabled: true
      age: 168h
      interval: 24h
      dryrun: false
    readonly:
      enabled: false
http:
  addr: :5000
  secret: ?????
  tls:
      certificate: /etc/minio/certs/public.crt
      key:         /etc/minio/certs/private.key
auth:
  htpasswd:
      realm: "Private docker registry"
      path: /etc/docker/registry/auth/registry.password

Run minio in as a container

sudo docker run -d \
   -p 9000:9000 \
   -p 9090:9090 \
   --name minio \
   -v ~/minio/data:/data \
   -e "MINIO_ROOT_USER=????" \
   -e "MINIO_ROOT_PASSWORD=????" \
   quay.io/minio/minio server /data --console-address ":9090"

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

docker logs minio

Run Docker registry in a container

docker run -d -p 5000:5000 \
  -v /etc/docker/registry/config.yml:/etc/docker/registry/config.yml \
  -v /etc/minio/certs/:/certs \
  --name=registry registry:2

Tag some image to push to the registry

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

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

Create username and password for user authenticated through docker login based on this tutorial

  sudo apt install apache2-utils -y 
  mkdir /etc/docker/registry/auth
  cd /etc/docker/registry/auth
  htpasswd -Bc registry.password username
  htpasswd -B registry.password username

Releases

No releases published

Packages

No packages published