use alpine's coreutils base64, which supports -w 0 to avoid wrapping -- thanks @miihael
parent
e72389b690
commit
72dc9a8819
|
@ -4,7 +4,7 @@ FROM rpardini/nginx-proxy-connect-stable-alpine:nginx-1.16.1-alpine-3.11
|
||||||
|
|
||||||
# Add openssl, bash and ca-certificates, then clean apk cache -- yeah complain all you want.
|
# Add openssl, bash and ca-certificates, then clean apk cache -- yeah complain all you want.
|
||||||
# Also added deps for mitmproxy.
|
# Also added deps for mitmproxy.
|
||||||
RUN apk add --update openssl bash ca-certificates su-exec git g++ libffi libffi-dev libstdc++ openssl openssl-dev python3 python3-dev \
|
RUN apk add --update openssl bash ca-certificates su-exec coreutils git g++ libffi libffi-dev libstdc++ openssl openssl-dev python3 python3-dev \
|
||||||
&& LDFLAGS=-L/lib pip3 install mitmproxy \
|
&& LDFLAGS=-L/lib pip3 install mitmproxy \
|
||||||
&& apk del --purge git g++ libffi-dev openssl-dev python3-dev \
|
&& apk del --purge git g++ libffi-dev openssl-dev python3-dev \
|
||||||
&& rm -rf /var/cache/apk/* \
|
&& rm -rf /var/cache/apk/* \
|
||||||
|
|
|
@ -57,8 +57,7 @@ if [ "$AUTH_REGISTRIES" ]; then
|
||||||
AUTH_HOST="${registry_array[0]}"
|
AUTH_HOST="${registry_array[0]}"
|
||||||
AUTH_USER="${registry_array[1]}"
|
AUTH_USER="${registry_array[1]}"
|
||||||
AUTH_PASS="${registry_array[2]}"
|
AUTH_PASS="${registry_array[2]}"
|
||||||
# make base64 not wrap lines: https://superuser.com/a/1225334
|
AUTH_BASE64=$(echo -n ${AUTH_USER}:${AUTH_PASS} | base64 -w0 | xargs)
|
||||||
AUTH_BASE64=$(echo -n "${AUTH_USER}:${AUTH_PASS}" | base64 | tr -d \\n )
|
|
||||||
echo "Adding Auth for registry '${AUTH_HOST}' with user '${AUTH_USER}'."
|
echo "Adding Auth for registry '${AUTH_HOST}' with user '${AUTH_USER}'."
|
||||||
echo "\"${AUTH_HOST}\" \"${AUTH_BASE64}\";" >> /etc/nginx/docker.auth.map
|
echo "\"${AUTH_HOST}\" \"${AUTH_BASE64}\";" >> /etc/nginx/docker.auth.map
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue