Skip to content

Commit

Permalink
using stretch slim package for less space and bandwidth requirements (#…
Browse files Browse the repository at this point in the history
…157)

Signed-off-by: Tully Foote <[email protected]>
  • Loading branch information
tfoote authored Aug 3, 2021
1 parent 2760838 commit df09084
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rocker/os_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@


DETECTION_TEMPLATE="""
FROM python:3-stretch as detector
FROM python:3-slim-stretch as detector
# Force the older version of debian for detector.
# GLIBC is forwards compatible but not necessarily backwards compatible for pyinstaller
# https://github.com/pyinstaller/pyinstaller/wiki/FAQ#gnulinux
# StaticX is supposed to take care of this but there appears to be an issue when using subprocess
RUN mkdir -p /tmp/distrovenv
RUN python3 -m venv /tmp/distrovenv
# patchelf needed for staticx
# binutils provides objdump needed by pyinstaller
RUN apt-get update && apt-get install -qy patchelf binutils
RUN . /tmp/distrovenv/bin/activate && pip install distro pyinstaller==4.0 staticx
RUN apt-get update && apt-get install -qy patchelf #needed for staticx
RUN echo 'import distro; import sys; output = (distro.name(), distro.version(), distro.codename()); print(output) if distro.name() else sys.exit(1)' > /tmp/distrovenv/detect_os.py
RUN . /tmp/distrovenv/bin/activate && pyinstaller --onefile /tmp/distrovenv/detect_os.py
Expand Down

0 comments on commit df09084

Please sign in to comment.