From 75bc9e08253956d2bbec909d4937dfb0060d6ca1 Mon Sep 17 00:00:00 2001 From: Jeff Bachtel Date: Tue, 28 Jan 2020 15:28:22 -0700 Subject: [PATCH] Move apk add and del into same layer Prevents bloating of final image --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index aff5cd8..9b83da5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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. # 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 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 +RUN apk add --update openssl bash ca-certificates su-exec git g++ libffi libffi-dev libstdc++ openssl openssl-dev python3 python3-dev \ + && LDFLAGS=-L/lib pip3 install mitmproxy \ + && apk del --purge git g++ libffi-dev openssl-dev python3-dev \ + && rm -rf /var/cache/apk/* \ + && rm -rf ~/.cache/pip # Required for mitmproxy ENV LANG=en_US.UTF-8