Skip to content

larrycai/nginx-auth-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:[email protected]

Then we see docker push is ok

docker login -u larrycai -p passwd -e "[email protected]" dokk.co
docker tag ubuntu dock.co/ubuntu
docker push dock.co/ubuntu

About

nginx auth proxy container

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%