Move apk add and del into same layer

Prevents bloating of final image
pull/30/head
Jeff Bachtel 2020-01-28 15:28:22 -07:00
parent 8ad0aaa25e
commit 75bc9e0825
1 changed files with 5 additions and 3 deletions

View File

@ -4,9 +4,11 @@ FROM rpardini/nginx-proxy-connect-stable-alpine:nginx-1.14.0-alpine-3.8
# 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 git g++ libffi libffi-dev libstdc++ openssl openssl-dev python3 python3-dev \
RUN LDFLAGS=-L/lib pip3 install mitmproxy && LDFLAGS=-L/lib pip3 install mitmproxy \
RUN apk del --purge git g++ libffi-dev openssl-dev python3-dev && rm -rf /var/cache/apk/* && rm -rf ~/.cache/pip && apk del --purge git g++ libffi-dev openssl-dev python3-dev \
&& rm -rf /var/cache/apk/* \
&& rm -rf ~/.cache/pip
# Required for mitmproxy # Required for mitmproxy
ENV LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8