Skip to content

Commit b335f0e

Browse files
committed
Cleanup: Set all default values in Dockerfile
1 parent c1a433d commit b335f0e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LABEL org.opencontainers.image.source https://github.com/rpardini/docker-registr
1313
RUN apk add --no-cache --update bash ca-certificates-bundle coreutils openssl
1414

1515
# If set to 1, enables building mitmproxy, which helps a lot in debugging, but is super heavy to build.
16-
ARG DEBUG_BUILD="1"
16+
ARG DEBUG_BUILD="0"
1717
ENV DO_DEBUG_BUILD="$DEBUG_BUILD"
1818

1919
# Build mitmproxy via pip. This is heavy, takes minutes do build and creates a 90mb+ layer. Oh well.
@@ -60,9 +60,10 @@ EXPOSE 8082
6060

6161
## Default envs.
6262
# A space delimited list of registries we should proxy and cache; this is in addition to the central DockerHub.
63-
ENV REGISTRIES="k8s.gcr.io gcr.io quay.io"
63+
ENV REGISTRIES="docker.caching.proxy.internal registry-1.docker.io auth.docker.io k8s.gcr.io gcr.io quay.io gitlab.com"
6464
# A space delimited list of registry:user:password to inject authentication for
65-
ENV AUTH_REGISTRIES="some.authenticated.registry:oneuser:onepassword another.registry:user:password"
65+
# (e.g. AUTH_REGISTRIES="auth.docker.io:dhuser:dhpass gitlab.com:gluser:glpass")
66+
ENV AUTH_REGISTRIES=""
6667
# Should we verify upstream's certificates? Default to true.
6768
ENV VERIFY_SSL="true"
6869
# Enable debugging mode; this inserts mitmproxy/mitmweb between the CONNECT proxy and the caching layer
@@ -72,6 +73,9 @@ ENV DEBUG_HUB="false"
7273
# Enable nginx debugging mode; this uses nginx-debug binary and enabled debug logging, which is VERY verbose so separate setting
7374
ENV DEBUG_NGINX="false"
7475

76+
# Set Docker Registry cache size, by default, 32 GB ('32g')
77+
ENV CACHE_MAX_SIZE="32g"
78+
7579
# Manifest caching tiers. Disabled by default, to mimick 0.4/0.5 behaviour.
7680
# Setting it to true enables the processing of the ENVs below.
7781
# Once enabled, it is valid for all registries, not only DockerHub.

entrypoint.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ALLDOMAINS=""
3636
echo -n "" > /etc/nginx/docker.intercept.map
3737

3838
# Some hosts/registries are always needed, but others can be configured in env var REGISTRIES
39-
for ONEREGISTRYIN in docker.caching.proxy.internal registry-1.docker.io auth.docker.io ${REGISTRIES}; do
39+
for ONEREGISTRYIN in ${REGISTRIES}; do
4040
ONEREGISTRY=$(echo ${ONEREGISTRYIN} | xargs) # Remove whitespace
4141
echo "Adding certificate for registry: $ONEREGISTRY"
4242
ALLDOMAINS="${ALLDOMAINS},DNS:${ONEREGISTRY}"
@@ -87,9 +87,6 @@ fi
8787
echo " listen 443 ssl default_server;" > /etc/nginx/caching.layer.listen
8888
echo "error_log /var/log/nginx/error.log warn;" > /etc/nginx/error.log.debug.warn
8989

90-
# Set Docker Registry cache size, by default, 32 GB ('32g')
91-
CACHE_MAX_SIZE=${CACHE_MAX_SIZE:-32g}
92-
9390
# The cache directory. This can get huge. Better to use a Docker volume pointing here!
9491
# Set to 32gb which should be enough
9592
echo "proxy_cache_path /docker_mirror_cache levels=1:2 max_size=$CACHE_MAX_SIZE inactive=60d keys_zone=cache:10m use_temp_path=off;" > /etc/nginx/conf.d/cache_max_size.conf

0 commit comments

Comments
 (0)