File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,13 @@ ENV PROXY_CONNECT_READ_TIMEOUT="60s"
146146ENV PROXY_CONNECT_CONNECT_TIMEOUT="60s"
147147ENV PROXY_CONNECT_SEND_TIMEOUT="60s"
148148
149- # Allow disabling IPV6 resolution, default to false
150- ENV DISABLE_IPV6="false"
149+ # Allow disabling IPV6 resolution, default to true
150+ ENV DISABLE_IPV6="true"
151+
152+ # Bitnami dockerhub overrides
153+ ENV BITNAMI_DOCKERHUB_HOST_OVERRIDE="false"
154+ ENV BITNAMI_HOST=""
155+ ENV BITNAMI_LEGACY_DOCKERHUB_URI_REWRITE="false"
151156
152157# Did you want a shell? Sorry, the entrypoint never returns, because it runs nginx itself. Use 'docker exec' if you need to mess around internally.
153158ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ ALLDOMAINS=""
5050echo -n " " > /etc/nginx/docker.intercept.map
5151
5252# Some hosts/registries are always needed, but others can be configured in env var REGISTRIES
53- for ONEREGISTRYIN in docker.caching.proxy.internal registry-1.docker.io auth.docker.io ${REGISTRIES} ; do
53+ for ONEREGISTRYIN in docker.caching.proxy.internal index.docker.io registry-1.docker.io auth.docker.io ${REGISTRIES} ; do
5454 ONEREGISTRY=$( echo ${ONEREGISTRYIN} | xargs) # Remove whitespace
5555 echo " Adding certificate for registry: $ONEREGISTRY "
5656 ALLDOMAINS=" ${ALLDOMAINS} ,DNS:${ONEREGISTRY} "
399399# Set worker processes if provided
400400sed -i " s/worker_processes auto;/worker_processes ${WORKER_PROCESSES} ;/g" /etc/nginx/nginx.conf
401401
402+ echo " " > /etc/nginx/nginx.manifest.override.conf
403+ if [[ " a${BITNAMI_DOCKERHUB_HOST_OVERRIDE} " == " atrue" && ${BITNAMI_HOST} != " " ]]; then
404+ cat << EOD >> /etc/nginx/nginx.manifest.override.conf
405+ set \$ overrideHost 0;
406+ if (\$ request_uri ~ ^/v2/bitnami/) {
407+ set \$ overrideHost 1;
408+ }
409+ if (\$ host !~* (^|\.)docker\.io$) {
410+ set \$ overrideHost 0;
411+ }
412+ if (\$ overrideHost) {
413+ set \$ targetHost "${BITNAMI_HOST} ";
414+ }
415+ EOD
416+ fi
417+
418+ if [[ " a${BITNAMI_LEGACY_DOCKERHUB_URI_REWRITE} " == " atrue" ]]; then
419+ cat << EOD >> /etc/nginx/nginx.manifest.override.conf
420+ set \$ doRewrite 0;
421+ if (\$ request_uri ~ ^/v2/bitnami/) {
422+ set \$ doRewrite 1;
423+ }
424+ if (\$ host !~* (^|\.)docker\.io$) {
425+ set \$ doRewrite 0;
426+ }
427+ if (\$ doRewrite) {
428+ rewrite ^/v2/bitnami/(.*)$ /v2/bitnamilegacy\$ 1 break;
429+ }
430+ EOD
431+ fi
432+
402433echo -e " \nFinal resolver configuration: ---"
403434cat " ${confpath} "
404435echo -e " ---\n"
Original file line number Diff line number Diff line change 11 # nginx config fragment included in every manifest-related location{} block.
2+ include "/etc/nginx/nginx.manifest.override.conf";
23 add_header X-Docker-Registry-Proxy-Cache-Upstream-Status "$upstream_cache_status";
34 add_header X-Docker-Registry-Proxy-Cache-Type "$docker_proxy_request_type";
45 proxy_pass https://$targetHost;
You can’t perform that action at this time.
0 commit comments