Created
April 28, 2015 14:02
-
-
Save leepa/d8b76029a2ea35661d86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy_pass http://REGISTRY_PORT_5000_TCP_ADDR:REGISTRY_PORT_5000_TCP_PORT; | |
proxy_set_header Host $http_host; # required for docker client's sake | |
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP | |
proxy_set_header Authorization ""; | |
proxy_read_timeout 900; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For going into conf.d/ | |
server { | |
listen 80; | |
server_name whatever.example.com; | |
client_max_body_size 0; | |
chunked_transfer_encoding on; | |
location / { | |
auth_basic "Restricted"; | |
auth_basic_user_file conf.d/htpasswd; | |
# https://github.com/docker/distribution/issues/397 | |
add_header Docker-Distribution-Api-Version registry/2.0 always; | |
# We'll auto generate this file | |
include /docker-registry.conf; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cp /etc/nginx/conf.d/docker-registry.tmpl /docker-registry.conf | |
[ -z "${REGISTRY_PORT_5000_TCP_ADDR}" ] && echo "\$REGISTRY_PORT_5000_TCP_ADDR is not set" || sed -i "s/REGISTRY_PORT_5000_TCP_ADDR/${REGISTRY_PORT_5000_TCP_ADDR}/" /docker-registry.conf | |
[ -z "${REGISTRY_PORT_5000_TCP_PORT}" ] && echo "\$REGISTRY_PORT_5000_TCP_PORT is not set" || sed -i "s/REGISTRY_PORT_5000_TCP_PORT/${REGISTRY_PORT_5000_TCP_PORT}/" /docker-registry.conf | |
/usr/sbin/nginx -g "daemon off;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment