From d3980791ef1cb3cae2d4c06aeecc6e80d8e075d7 Mon Sep 17 00:00:00 2001 From: threatnoodle Date: Wed, 20 Jan 2016 08:55:59 +0000 Subject: [PATCH] Redoing mitmproxy for the ubuntu image to workaround building pillow==3.0 on Alpine Linux --- mitmproxy/Dockerfile | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/mitmproxy/Dockerfile b/mitmproxy/Dockerfile index 07acf1a..e093545 100644 --- a/mitmproxy/Dockerfile +++ b/mitmproxy/Dockerfile @@ -1,19 +1,31 @@ -FROM alpine:latest +FROM ubuntu:latest MAINTAINER Jessica Frazelle +RUN apt-get update && apt-get install -y \ + python \ + python-dev \ + python-virtualenv + +RUN buildDeps=' \ + libjpeg8-dev \ + libffi-dev \ + libssl-dev \ + libxml2-dev \ + libxslt1-dev \ + zlib1g-dev \ + ' \ + && set -x \ + && apt-get install -y ${buildDeps} --no-install-recommends \ + && useradd -m mitm \ + && su -c "virtualenv /home/mitm/mitmproxy" mitm \ + && su -c "/home/mitm/mitmproxy/bin/pip install Pillow==3.0 mitmproxy" mitm \ + && apt-get purge -y --auto-remove ${buildDeps} build-essential gcc \ + && rm -rf /var/lib/apt/lists/* + +EXPOSE 8080 + +ENV HOME /home/mitm ENV LANG en_US.UTF-8 -RUN apk update && apk add \ - build-base \ - ca-certificates \ - libffi-dev \ - libxml2-dev \ - libxslt-dev \ - openssl-dev \ - python \ - python-dev \ - py-pip \ - && rm -rf /var/cache/apk/* \ - && pip install pillow==2.8.0 mitmproxy - -CMD [ "mitmproxy" ] +USER mitm +CMD [ "/home/mitm/mitmproxy/bin/python", "/home/mitm/mitmproxy/bin/mitmproxy" ]