Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description

Nginx authentication proxy, works with private docker registry

(forked from https://github.com/opendns/nginx-auth-proxy for nginx env, but totally changed for this)

Try to run nginx docker container in front of registry container

Mostly it follows the blog Building private Docker registry with basic authentication

nginx's configuration comes from https://github.com/docker/docker-registry/tree/master/contrib/nginx

!!! All the certifications inside are generated for demo purpose inside. !!!

It works successfully under boot2docker windows environment.

You need to append dokk.co (testing domain name) in /etc/hosts's localhost

127.0.0.1 boot2docker localhost localhost.local dokk.co

Download and add ca.pem into your ca trust list.

$ sudo cat ca.pem >> /etc/ssl/certs/ca-certificates.crt
$ sudo /etc/init.d/docker restart

Then you can start two docker containers to try

docker run -d --name registry -p 5000:5000 registry
docker run -d --hostname dokk.co --name nginx --link registry:registry -p 443:443 larrycai/nginx-auth-proxy

verify

open browser to access https://192.168.59.103 , it shall show the nginx https works fine.

Now verify the https basic auth is ok

curl -i -k https://larrycai:passwd@dokk.co

Then we see docker push is ok

docker login -u larrycai -p passwd -e "test@gmail.com" dokk.co
docker tag ubuntu dock.co/ubuntu
docker push dock.co/ubuntu
Docker Pull Command
Owner
larrycai
Source Repository