Skip to content

Commit

Permalink
Add build.sh script and more base image variations
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed May 9, 2020
1 parent 98016b4 commit 79bfca0
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
65 changes: 65 additions & 0 deletions Dockerfile-py3-focal-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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 \
# 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 \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.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 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.
65 changes: 65 additions & 0 deletions Dockerfile-py3-xenial-amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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 \
# 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 \
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
&& source ~/.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 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.
66 changes: 66 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh

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

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

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

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

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

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

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

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

0 comments on commit 79bfca0

Please sign in to comment.