From 1e00af61bba52538a009c3372079331adb77a0d7 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Wed, 20 Jan 2016 09:39:12 -0800 Subject: [PATCH] try to make mitmproxy smaller Signed-off-by: Jessica Frazelle --- mitmproxy/Dockerfile | 52 ++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/mitmproxy/Dockerfile b/mitmproxy/Dockerfile index 2155270..10f3ebc 100644 --- a/mitmproxy/Dockerfile +++ b/mitmproxy/Dockerfile @@ -1,33 +1,37 @@ -FROM ubuntu:latest +FROM debian:jessie MAINTAINER Jessica Frazelle RUN apt-get update && apt-get install -y \ - libxslt1.1 \ - libjpeg8 \ - python \ - python-dev \ - python-virtualenv + libxslt1.1 \ + libjpeg62-turbo \ + python-minimal \ + python-pip \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* -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} \ - && rm -rf /var/lib/apt/lists/* +ENV LANG en_US.UTF-8 +ENV HOME /home/mitm +RUN useradd --create-home --home-dir $HOME mitm \ + && chown -R mitm:mitm $HOME EXPOSE 8080 -ENV HOME /home/mitm -ENV LANG en_US.UTF-8 +RUN buildDeps=' \ + gcc \ + libjpeg-dev \ + libffi-dev \ + libssl-dev \ + libxml2-dev \ + libxslt1-dev \ + python-dev \ + zlib1g-dev \ + ' \ + && set -x \ + && apt-get update && apt-get install -y ${buildDeps} --no-install-recommends \ + && pip install mitmproxy \ + && apt-get purge -y --auto-remove ${buildDeps} \ + && rm -rf /var/lib/apt/lists/* USER mitm -CMD [ "/home/mitm/mitmproxy/bin/python", "/home/mitm/mitmproxy/bin/mitmproxy" ] + +ENTRYPOINT [ "mitmproxy" ]