Giter VIP home page Giter VIP logo

docker-registry's Introduction

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

docker-registry's People

Contributors

sina88 avatar zahranajaf avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.