Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/forward base images #112

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions Dockerfile-py2-amd64
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM ubuntu:12.04
SHELL ["/bin/bash", "-i", "-c"]
FROM ubuntu:18.04

ARG PYTHON_VERSION=2.7.17
ARG PYINSTALLER_VERSION=3.6
Expand All @@ -8,6 +7,10 @@ ENV PYPI_URL=https://pypi.python.org/
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
ENV PYENV_VERSION=${PYTHON_VERSION}

# set compilation environment for python
ENV PYTHON_CONFIGURE_OPTS=--enable-shared
ENV CPPFLAGS=-O2

COPY entrypoint-linux.sh /entrypoint.sh

RUN \
Expand All @@ -27,31 +30,25 @@ RUN \
libssl-dev \
zlib1g-dev \
libffi-dev \
openssl \
#optional libraries
libgdbm-dev \
libgdbm3 \
# libgdbm5 for ubuntu 18.04
# libgdbm6 for ubuntu 20.04
libgdbm5 \
uuid-dev \
#upx
upx \
# required because openSSL on Ubuntu 12.04 and 14.04 run out of support versions of OpenSSL
&& mkdir openssl \
&& cd openssl \
# latest version, there won't be anything newer for this
&& wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz \
&& tar -xzvf openssl-1.0.2u.tar.gz \
&& cd openssl-1.0.2u \
&& ./config --prefix=$HOME/openssl --openssldir=$HOME/openssl shared zlib \
&& make \
&& make install \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& source ~/.bashrc \
&& . ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> ~/.bashrc \
&& . ~/.bashrc \
# install python
&& PATH="$HOME/openssl:$PATH" CPPFLAGS="-O2 -I$HOME/openssl/include" CFLAGS="-I$HOME/openssl/include/" LDFLAGS="-L$HOME/openssl/lib -Wl,-rpath,$HOME/openssl/lib" LD_LIBRARY_PATH=$HOME/openssl/lib:$LD_LIBRARY_PATH LD_RUN_PATH="$HOME/openssl/lib" CONFIGURE_OPTS="--with-openssl=$HOME/openssl" PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYTHON_VERSION \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pip install --upgrade pip \
# install pyinstaller
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-py2-win32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:14.04
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

Expand Down
33 changes: 15 additions & 18 deletions Dockerfile-py3-amd64
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM ubuntu:12.04
SHELL ["/bin/bash", "-i", "-c"]
FROM ubuntu:18.04

ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6
ARG PYTHON_VERSION=3.9.6
ARG PYINSTALLER_VERSION=4.2

ENV PYPI_URL=https://pypi.python.org/
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
ENV PYENV_VERSION=${PYTHON_VERSION}

# set compilation environment for python
ENV PYTHON_CONFIGURE_OPTS=--enable-shared
ENV CPPFLAGS=-O2

COPY entrypoint-linux.sh /entrypoint.sh

RUN \
Expand All @@ -27,31 +30,25 @@ RUN \
libssl-dev \
zlib1g-dev \
libffi-dev \
openssl \
#optional libraries
libgdbm-dev \
libgdbm3 \
# libgdbm5 for ubuntu 18.04
# libgdbm6 for ubuntu 20.04
libgdbm5 \
uuid-dev \
#upx
upx \
# required because openSSL on Ubuntu 12.04 and 14.04 run out of support versions of OpenSSL
&& mkdir openssl \
&& cd openssl \
# latest version, there won't be anything newer for this
&& wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz \
&& tar -xzvf openssl-1.0.2u.tar.gz \
&& cd openssl-1.0.2u \
&& ./config --prefix=$HOME/openssl --openssldir=$HOME/openssl shared zlib \
&& make \
&& make install \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& source ~/.bashrc \
&& . ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> ~/.bashrc \
&& . ~/.bashrc \
# install python
&& PATH="$HOME/openssl:$PATH" CPPFLAGS="-O2 -I$HOME/openssl/include" CFLAGS="-I$HOME/openssl/include/" LDFLAGS="-L$HOME/openssl/lib -Wl,-rpath,$HOME/openssl/lib" LD_LIBRARY_PATH=$HOME/openssl/lib:$LD_LIBRARY_PATH LD_RUN_PATH="$HOME/openssl/lib" CONFIGURE_OPTS="--with-openssl=$HOME/openssl" PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYTHON_VERSION \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pip install --upgrade pip \
# install pyinstaller
Expand Down
35 changes: 16 additions & 19 deletions Dockerfile-py3-i386
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM i386/ubuntu:12.04
SHELL ["/bin/bash", "-i", "-c"]
FROM i386/ubuntu:18.04

ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6
ARG PYTHON_VERSION=3.9.6
ARG PYINSTALLER_VERSION=4.2

ENV PYPI_URL=https://pypi.python.org/
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
ENV PYENV_VERSION=${PYTHON_VERSION}

# set compilation environment for python
ENV PYTHON_CONFIGURE_OPTS=--enable-shared
ENV CPPFLAGS=-O2

COPY entrypoint-linux.sh /entrypoint.sh

RUN \
Expand All @@ -27,31 +30,25 @@ RUN \
libssl-dev \
zlib1g-dev \
libffi-dev \
openssl \
#optional libraries
libgdbm-dev \
libgdbm3 \
# libgdbm5 for ubuntu 18.04
# libgdbm6 for ubuntu 20.04
libgdbm5 \
uuid-dev \
#upx
#upx # why is this needed?
upx \
# required because openSSL on Ubuntu 12.04 and 14.04 run out of support versions of OpenSSL
&& mkdir openssl \
&& cd openssl \
# latest version, there won't be anything newer for this
&& wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz \
&& tar -xzvf openssl-1.0.2u.tar.gz \
&& cd openssl-1.0.2u \
&& ./Configure linux-generic32 --prefix=$HOME/openssl --openssldir=$HOME/openssl shared zlib \
&& make \
&& make install \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& source ~/.bashrc \
&& . ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> ~/.bashrc \
&& . ~/.bashrc \
# install python
&& PATH="$HOME/openssl:$PATH" CPPFLAGS="-O2 -I$HOME/openssl/include" CFLAGS="-I$HOME/openssl/include/" LDFLAGS="-L$HOME/openssl/lib -Wl,-rpath,$HOME/openssl/lib" LD_LIBRARY_PATH=$HOME/openssl/lib:$LD_LIBRARY_PATH LD_RUN_PATH="$HOME/openssl/lib" CONFIGURE_OPTS="--with-openssl=$HOME/openssl" PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $PYTHON_VERSION \
&& pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pip install --upgrade pip \
# install pyinstaller
Expand Down
35 changes: 21 additions & 14 deletions Dockerfile-py3-win32
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM ubuntu:16.04
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

ARG WINE_VERSION=winehq-staging
ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6
ARG PYTHON_VERSION=3.9.6
ARG PYINSTALLER_VERSION=4.2

# we need wine for this all to work, so we'll use the PPA
RUN set -x \
&& dpkg --add-architecture i386 \
&& apt-get update -qy \
&& apt-get install --no-install-recommends -qfy apt-transport-https software-properties-common wget \
&& apt-get install --no-install-recommends -qfy apt-transport-https software-properties-common wget xvfb xdotool x11-utils xterm gpg-agent rename \
&& wget -nv https://dl.winehq.org/wine-builds/winehq.key \
&& apt-key add winehq.key \
&& add-apt-repository 'https://dl.winehq.org/wine-builds/ubuntu/' \
Expand All @@ -26,6 +26,12 @@ ENV WINEARCH win32
ENV WINEDEBUG fixme-all
ENV WINEPREFIX /wine

# xvfb settings
# from https://github.com/engineervix/docker-pyinstaller/blob/b99163b6eb0a81fc9a0bfd498c09c4e0253d01b2/Dockerfile-py3-win64#L56-L59
ENV DISPLAY :0
RUN set -x \
&& echo 'Xvfb $DISPLAY -screen 0 1024x768x24 &' >> /root/.bashrc

# PYPI repository location
ENV PYPI_URL=https://pypi.python.org/
# PYPI index location
Expand All @@ -37,17 +43,17 @@ RUN set -x \
&& winetricks win7 \
&& for msifile in `echo core dev exe lib path pip tcltk tools`; do \
wget -nv "https://www.python.org/ftp/python/$PYTHON_VERSION/win32/${msifile}.msi"; \
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python37; \
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python39; \
rm ${msifile}.msi; \
done \
&& cd /wine/drive_c/Python37 \
&& echo 'wine '\''C:\Python37\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python37\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python37\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python37\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python37\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
&& cd /wine/drive_c/Python39 \
&& echo 'wine '\''C:\Python39\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python39\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python39\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python39\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python39\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
&& echo 'assoc .py=PythonScript' | wine cmd \
&& echo 'ftype PythonScript=c:\Python37\python.exe "%1" %*' | wine cmd \
&& echo 'ftype PythonScript=c:\Python39\python.exe "%1" %*' | wine cmd \
&& while pgrep wineserver >/dev/null; do echo "Waiting for wineserver"; sleep 1; done \
&& chmod +x /usr/bin/python /usr/bin/easy_install /usr/bin/pip /usr/bin/pyinstaller /usr/bin/pyupdater \
&& (pip install -U pip || true) \
Expand All @@ -61,8 +67,9 @@ ENV W_TMP="$W_DRIVE_C/windows/temp/_$0"
# install Microsoft Visual C++ Redistributable for Visual Studio 2017 dll files
RUN set -x \
&& rm -f "$W_TMP"/* \
&& wget -P "$W_TMP" https://download.visualstudio.microsoft.com/download/pr/11687613/88b50ce70017bf10f2d56d60fcba6ab1/VC_redist.x86.exe \
&& cabextract -q --directory="$W_TMP" "$W_TMP"/VC_redist.x86.exe \
&& wget -P "$W_TMP" https://aka.ms/vs/16/release/vc_redist.x86.exe \
# https://download.visualstudio.microsoft.com/download/pr/221ed2ae-1269-497b-a962-e113045001fa/1ACD8D5EA1CDC3EB2EB4C87BE3AB28722D0825C15449E5C9CEEF95D897DE52FA/VC_redist.x86.exe
&& cabextract -q --directory="$W_TMP" "$W_TMP"/vc_redist.x86.exe \
&& cabextract -q --directory="$W_TMP" "$W_TMP/a10" \
&& cabextract -q --directory="$W_TMP" "$W_TMP/a11" \
&& cd "$W_TMP" \
Expand Down
39 changes: 24 additions & 15 deletions Dockerfile-py3-win64
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM ubuntu:16.04
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

ARG WINE_VERSION=winehq-staging
ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6
ARG PYTHON_VERSION=3.9.6
ARG PYINSTALLER_VERSION=4.2

# we need wine for this all to work, so we'll use the PPA
RUN set -x \
&& dpkg --add-architecture i386 \
&& apt-get update -qy \
&& apt-get install --no-install-recommends -qfy apt-transport-https software-properties-common wget \
&& apt-get install --no-install-recommends -qfy apt-transport-https software-properties-common wget xvfb xdotool x11-utils xterm gpg-agent rename \
&& wget -nv https://dl.winehq.org/wine-builds/winehq.key \
&& apt-key add winehq.key \
&& add-apt-repository 'https://dl.winehq.org/wine-builds/ubuntu/' \
Expand All @@ -26,6 +26,12 @@ ENV WINEARCH win64
ENV WINEDEBUG fixme-all
ENV WINEPREFIX /wine

# xvfb settings
# from https://github.com/engineervix/docker-pyinstaller/blob/b99163b6eb0a81fc9a0bfd498c09c4e0253d01b2/Dockerfile-py3-win64#L56-L59
ENV DISPLAY :0
RUN set -x \
&& echo 'Xvfb $DISPLAY -screen 0 1024x768x24 &' >> /root/.bashrc

# PYPI repository location
ENV PYPI_URL=https://pypi.python.org/
# PYPI index location
Expand All @@ -37,17 +43,17 @@ RUN set -x \
&& winetricks win7 \
&& for msifile in `echo core dev exe lib path pip tcltk tools`; do \
wget -nv "https://www.python.org/ftp/python/$PYTHON_VERSION/amd64/${msifile}.msi"; \
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python37; \
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python39; \
rm ${msifile}.msi; \
done \
&& cd /wine/drive_c/Python37 \
&& echo 'wine '\''C:\Python37\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python37\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python37\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python37\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python37\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
&& cd /wine/drive_c/Python39 \
&& echo 'wine '\''C:\Python39\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python39\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python39\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python39\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python39\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
&& echo 'assoc .py=PythonScript' | wine cmd \
&& echo 'ftype PythonScript=c:\Python37\python.exe "%1" %*' | wine cmd \
&& echo 'ftype PythonScript=c:\Python39\python.exe "%1" %*' | wine cmd \
&& while pgrep wineserver >/dev/null; do echo "Waiting for wineserver"; sleep 1; done \
&& chmod +x /usr/bin/python /usr/bin/easy_install /usr/bin/pip /usr/bin/pyinstaller /usr/bin/pyupdater \
&& (pip install -U pip || true) \
Expand All @@ -61,10 +67,13 @@ ENV W_TMP="$W_DRIVE_C/windows/temp/_$0"
# install Microsoft Visual C++ Redistributable for Visual Studio 2017 dll files
RUN set -x \
&& rm -f "$W_TMP"/* \
&& wget -P "$W_TMP" https://download.visualstudio.microsoft.com/download/pr/11100230/15ccb3f02745c7b206ad10373cbca89b/VC_redist.x64.exe \
&& cabextract -q --directory="$W_TMP" "$W_TMP"/VC_redist.x64.exe \
&& cabextract -q --directory="$W_TMP" "$W_TMP/a10" \
&& wget -P "$W_TMP" https://aka.ms/vs/16/release/vc_redist.x64.exe \
# https://download.visualstudio.microsoft.com/download/pr/36e45907-8554-4390-ba70-9f6306924167/97CC5066EB3C7246CF89B735AE0F5A5304A7EE33DC087D65D9DFF3A1A73FE803/VC_redist.x64.exe
&& ls "$W_TMP"/ \
&& cabextract -q --directory="$W_TMP" "$W_TMP"/vc_redist.x64.exe \
&& cabextract -q --directory="$W_TMP" "$W_TMP/a11" \
&& cabextract -q --directory="$W_TMP" "$W_TMP/a12" \
&& cabextract -q --directory="$W_TMP" "$W_TMP/a13" \
&& cd "$W_TMP" \
&& rename 's/_/\-/g' *.dll \
&& cp "$W_TMP"/*.dll "$W_SYSTEM64_DLLS"/
Expand Down