From 852a0d8a1ac7e34a522ef3f70a868bf8f0990dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Br=C3=BCnings?= Date: Mon, 18 Feb 2019 20:19:26 +0100 Subject: [PATCH] Use PyInstaller and a separate build image... to reduce the size of the final container. Update from jessie to stretch. --- Dockerfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 114bc34..5ef678e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,16 +2,23 @@ # # VERSION 0.1 -FROM debian:jessie-slim -MAINTAINER Richard North - -LABEL Description="This image can be used to create a sidekick container for recording videos of VNC sessions hosted in other containers" +FROM debian:stretch-slim as build_image RUN apt-get update && apt-get install -y \ python-pip python-dev \ && rm -rf /var/lib/apt/lists/* +RUN pip install pyinstaller RUN pip install vnc2flv -ENTRYPOINT ["flvrec.py"] +RUN PYTHONOPTIMIZE=1 pyinstaller --onedir --distpath /tmp/flvrec /usr/local/bin/flvrec.py + +FROM debian:stretch-slim +MAINTAINER Richard North + +LABEL Description="This image can be used to create a sidekick container for recording videos of VNC sessions hosted in other containers" + +COPY --from=build_image /tmp/flvrec /usr + +ENTRYPOINT ["/usr/flvrec/flvrec"] CMD ["--help"]