Skip to content

Commit 72dc9a8

Browse files
author
ricardop
committed
use alpine's coreutils base64, which supports -w 0 to avoid wrapping -- thanks @miihael
1 parent e72389b commit 72dc9a8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM rpardini/nginx-proxy-connect-stable-alpine:nginx-1.16.1-alpine-3.11
44

55
# Add openssl, bash and ca-certificates, then clean apk cache -- yeah complain all you want.
66
# Also added deps for mitmproxy.
7-
RUN apk add --update openssl bash ca-certificates su-exec git g++ libffi libffi-dev libstdc++ openssl openssl-dev python3 python3-dev \
7+
RUN apk add --update openssl bash ca-certificates su-exec coreutils git g++ libffi libffi-dev libstdc++ openssl openssl-dev python3 python3-dev \
88
&& LDFLAGS=-L/lib pip3 install mitmproxy \
99
&& apk del --purge git g++ libffi-dev openssl-dev python3-dev \
1010
&& rm -rf /var/cache/apk/* \

entrypoint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ if [ "$AUTH_REGISTRIES" ]; then
5757
AUTH_HOST="${registry_array[0]}"
5858
AUTH_USER="${registry_array[1]}"
5959
AUTH_PASS="${registry_array[2]}"
60-
# make base64 not wrap lines: https://superuser.com/a/1225334
61-
AUTH_BASE64=$(echo -n "${AUTH_USER}:${AUTH_PASS}" | base64 | tr -d \\n )
60+
AUTH_BASE64=$(echo -n ${AUTH_USER}:${AUTH_PASS} | base64 -w0 | xargs)
6261
echo "Adding Auth for registry '${AUTH_HOST}' with user '${AUTH_USER}'."
6362
echo "\"${AUTH_HOST}\" \"${AUTH_BASE64}\";" >> /etc/nginx/docker.auth.map
6463
done

0 commit comments

Comments
 (0)