Skip to content
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
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions Dockerfile-py3-focal-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM ubuntu:20.04
SHELL ["/bin/bash", "-i", "-c"]

ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6

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

COPY entrypoint-linux.sh /entrypoint.sh

RUN \
set -x \
# update system
&& apt-get update \
# install requirements
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
wget \
git \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
zlib1g-dev \
libffi-dev \
#optional libraries
libgdbm-dev \
libgdbm6 \
uuid-dev \
#upx
upx \
libssl-dev \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& source ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.bashrc \
# install python
&& CONFIGURE_OPTS=--enable-shared pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pip install --upgrade pip \
# install pyinstaller
&& pip install pyinstaller==$PYINSTALLER_VERSION \
&& mkdir /src/ \
&& chmod +x /entrypoint.sh

VOLUME /src/
WORKDIR /src/

ENTRYPOINT ["/entrypoint.sh"]
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions Dockerfile-py3-xenial-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM ubuntu:16.04
SHELL ["/bin/bash", "-i", "-c"]

ARG PYTHON_VERSION=3.7.5
ARG PYINSTALLER_VERSION=3.6

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

COPY entrypoint-linux.sh /entrypoint.sh

RUN \
set -x \
# update system
&& apt-get update \
# install requirements
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
curl \
wget \
git \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
zlib1g-dev \
libffi-dev \
#optional libraries
libgdbm-dev \
libgdbm3 \
uuid-dev \
#upx
upx \
libssl-dev \
# install pyenv
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
&& source ~/.bashrc \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.bashrc \
# install python
&& CONFIGURE_OPTS=--enable-shared pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION \
&& pip install --upgrade pip \
# install pyinstaller
&& pip install pyinstaller==$PYINSTALLER_VERSION \
&& mkdir /src/ \
&& chmod +x /entrypoint.sh

VOLUME /src/
WORKDIR /src/

ENTRYPOINT ["/entrypoint.sh"]
16 changes: 8 additions & 8 deletions Dockerfile-py3-win32 → Dockerfile-py3-xenial-win32
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,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:/Python; \
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/Python \
&& echo 'wine '\''C:\Python\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python\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:\Python\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 Down
16 changes: 8 additions & 8 deletions Dockerfile-py3-win64 → Dockerfile-py3-xenial-win64
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,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:/Python; \
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/Python \
&& echo 'wine '\''C:\Python\python.exe'\'' "$@"' > /usr/bin/python \
&& echo 'wine '\''C:\Python\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
&& echo 'wine '\''C:\Python\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
&& echo 'wine '\''C:\Python\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
&& echo 'wine '\''C:\Python\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:\Python\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 Down
69 changes: 69 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/sh

# Run NAMESPACE=custom ./build.sh to customize images namespace
NAMESPACE=${NAMESPACE-cdrx}

echo "Building Default Linux image (Python 3, Precise, 64bit)"
docker build -f Dockerfile-py3-precise-amd64 \
-t $NAMESPACE/pyinstaller-linux \
-t $NAMESPACE/pyinstaller-linux:64bit \
-t $NAMESPACE/pyinstaller-linux:python3 \
-t $NAMESPACE/pyinstaller-linux:precise \
-t $NAMESPACE/pyinstaller-linux:python3-64bit \
-t $NAMESPACE/pyinstaller-linux:python3-precise \
-t $NAMESPACE/pyinstaller-linux:python3-precise-64bit \
.

echo "Building Default Windows image (Python 3, Xenial, 64bit)"
docker build -f Dockerfile-py3-xenial-win64 \
-t $NAMESPACE/pyinstaller-windows \
-t $NAMESPACE/pyinstaller-windows:64bit \
-t $NAMESPACE/pyinstaller-windows:xenial \
-t $NAMESPACE/pyinstaller-windows:python3 \
-t $NAMESPACE/pyinstaller-windows:python3-64bit \
-t $NAMESPACE/pyinstaller-windows:python3-xenial \
-t $NAMESPACE/pyinstaller-windows:python3-xenial-64bit \
.

echo "Building Default Linux 32 bits image (Python 3, Precise, 32bit)"
docker build -f Dockerfile-py3-precise-i386 \
-t $NAMESPACE/pyinstaller-linux:32bit \
-t $NAMESPACE/pyinstaller-linux:python3-32bit \
-t $NAMESPACE/pyinstaller-linux:python3-precise-32bit \
.

echo "Building Default Windows 32 bits image (Python 3, Xenial, 32bit)"
docker build -f Dockerfile-py3-xenial-win32 \
-t $NAMESPACE/pyinstaller-windows:32bit \
-t $NAMESPACE/pyinstaller-windows:python3-32bit \
-t $NAMESPACE/pyinstaller-windows:python3-xenial-32bit \
.

echo "Building Default Windows Python 2 image (Python 2, Trusty, 32bit)"
docker build -f Dockerfile-py2-trusty-win32 \
-t $NAMESPACE/pyinstaller-linux:python2 \
-t $NAMESPACE/pyinstaller-linux:python2-trusty \
-t $NAMESPACE/pyinstaller-linux:python2-32bit \
-t $NAMESPACE/pyinstaller-linux:python2-trusty-32bit \
.

echo "Building Default Linux Python 2 image (Python 2, Precise, 64bit)"
docker build -f Dockerfile-py2-precise-amd64 \
-t $NAMESPACE/pyinstaller-linux:python2 \
-t $NAMESPACE/pyinstaller-linux:python2-precise \
-t $NAMESPACE/pyinstaller-linux:python2-precise-64bit \
.

echo "Building Default Linux Focal image (Python 3, Focal, 64bit)"
docker build -f Dockerfile-py3-focal-amd64 \
-t $NAMESPACE/pyinstaller-linux:focal \
-t $NAMESPACE/pyinstaller-linux:python3-focal \
-t $NAMESPACE/pyinstaller-linux:python3-focal-64bit \
.

echo "Building Default Linux Xenial image (Python 3, Xenial, 64bit)"
docker build -f Dockerfile-py3-xenial-amd64 \
-t $NAMESPACE/pyinstaller-linux:xenial \
-t $NAMESPACE/pyinstaller-linux:python3-xenial \
-t $NAMESPACE/pyinstaller-linux:python3-xenial-64bit \
.
4 changes: 2 additions & 2 deletions entrypoint-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ fi

cd $WORKDIR

if [ -f requirements.txt ]; then
if [ -f requirements.txt ] && [ -z "$DISABLE_REQUIREMENTS" ]; then
pip install -r requirements.txt
fi # [ -f requirements.txt ]
fi

echo "$@"

Expand Down
4 changes: 2 additions & 2 deletions entrypoint-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ fi

cd $WORKDIR

if [ -f requirements.txt ]; then
if [ -f requirements.txt ] && [ -z "$DISABLE_REQUIREMENTS" ]; then
pip install -r requirements.txt
fi # [ -f requirements.txt ]
fi

echo "$@"

Expand Down