Giter Site home page Giter Site logo

akm / nginx-docker-registry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nagachika/nginx-docker-registry

0.0 3.0 0.0 92 KB

ngx_mruby scripts&configuration for docker-registry frontend.

License: MIT License

Ruby 70.68% ApacheConf 4.53% Nginx 24.79%

nginx-docker-registry's Introduction

nginx-docker-registry

Docker image of nginx reverse proxy for docker-registry.

  • Add Basic Authentication
    • account information derived from Redis
  • Access control
  • SSL endpoint

TODO

  • select upstream server according to authenticated user
  • performance tuning

Quick Start

  1. prepare certificate files
$ mkdir ssl
$ cd ssl
$ echo 01 > ca.srl
$ openssl genrsa -des3 -out ca-key.pem 2048
$ openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem
$ openssl genrsa -des3 -out docker-registry-key.pem 2048
$ openssl req -subj '/CN=<Your Hostname Here>' -new -key docker-registry-key.pem -out server.csr
$ openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem -out docker-registry-cert.pem
$ openssl rsa -in docker-registry-key.pem -out docker-registry-key.pem
$ cd ../
  1. start containers
$ dockre run -d -p 6379:6379 redis:latest
$ docker run -d -p 5000:5000 registry
$ docker run -d -v `pwd`/ssl -p 443:443 -e REDIS_HOST=172.17.42.1 -e DIGEST_SALT=salt nagachika/nginx-docker-registry
  1. prepare account information & proxy upstream
# get digest string for the password
$ ruby -rdigest -e 'puts Digest::SHA1.hexdigest("salt:password")'
(copy digest string)
$ redis-cli
> hset docker-registry:passwords user1 (copied digest string)
> lpush docker-registry:backends 172.17.42.1:5000

nginx-docker-registry's People

Contributors

nagachika avatar

Watchers

Takeshi Akima avatar James Cloos avatar  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.