Skip to content

Commit 0adb1c6

Browse files
committed
Add bionic support and generate build.sh/push.sh from a python script
1 parent dcf9182 commit 0adb1c6

17 files changed

+3476
-148
lines changed

.github/workflows/build-push-to-docker-hub.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@ name: CI
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master ]
10-
pull_request:
11-
branches: [ master ]
9+
branches:
10+
- "master"
11+
- "release/*"
1212

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1413
jobs:
15-
# This workflow contains a single job called "build"
1614
build:
17-
# The type of runner that the job will run on
1815
runs-on: ubuntu-latest
1916

20-
# Steps represent a sequence of tasks that will be executed as part of the job
2117
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2318
- uses: actions/checkout@v2
2419

25-
# Runs a single command using the runners shell
26-
- name: Run a one-line script
27-
run: echo Hello, world!
20+
- uses: azure/docker-login@v1
21+
with:
22+
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
23+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
2824

29-
# Runs a set of commands using the runners shell
30-
- name: Run a multi-line script
25+
- name: Build images
3126
run: |
32-
echo Add other actions to build,
33-
echo test, and deploy your project.
27+
./build.sh
28+
29+
- name: Push images
30+
run: |
31+
./push.sh

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches:
10+
- "develop"
11+
pull_request:
12+
branches:
13+
- "*"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Build images
23+
run: |
24+
./build.sh

Dockerfile-py2-precise-amd64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:12.04
1+
FROM ubuntu:precise
22
SHELL ["/bin/bash", "-i", "-c"]
33

44
ARG PYTHON_VERSION=2.7.17

Dockerfile-py2-trusty-win32

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM ubuntu:14.04
1+
FROM ubuntu:trusty
22

33
ENV DEBIAN_FRONTEND noninteractive
44

5-
ARG WINE_VERSION=winehq-devel
5+
ARG WINE_VERSION=devel
66
ARG PYTHON_VERSION=2.7.12
77
ARG PYINSTALLER_VERSION=3.6
88

@@ -13,7 +13,7 @@ RUN set -x \
1313
&& apt-get install --no-install-recommends -qfy software-properties-common \
1414
&& add-apt-repository ppa:wine/wine-builds \
1515
&& apt-get update -qy \
16-
&& apt-get install --no-install-recommends -qfy $WINE_VERSION winetricks wget \
16+
&& apt-get install --no-install-recommends -qfy winehq-$WINE_VERSION winetricks wget \
1717
&& apt-get clean
1818

1919
# wine settings

Dockerfile-py3-bionic-amd64

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
FROM ubuntu:bionic
2+
SHELL ["/bin/bash", "-i", "-c"]
3+
4+
ARG PYTHON_VERSION=3.7.9
5+
ARG PYINSTALLER_VERSION=4.0
6+
7+
ENV PYPI_URL=https://pypi.python.org/
8+
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
9+
ENV PYENV_VERSION=${PYTHON_VERSION}
10+
11+
COPY entrypoint-linux.sh /entrypoint.sh
12+
13+
RUN \
14+
set -x \
15+
# update system
16+
&& apt-get update \
17+
# install requirements
18+
&& apt-get install -y --no-install-recommends \
19+
build-essential \
20+
ca-certificates \
21+
curl \
22+
wget \
23+
git \
24+
libbz2-dev \
25+
libreadline-dev \
26+
libsqlite3-dev \
27+
libssl-dev \
28+
zlib1g-dev \
29+
libffi-dev \
30+
#optional libraries
31+
libgdbm-dev \
32+
libgdbm5 \
33+
uuid-dev \
34+
#upx
35+
upx \
36+
libssl-dev \
37+
# install pyenv
38+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
39+
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
40+
&& source ~/.bashrc \
41+
&& curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash \
42+
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc \
43+
&& source ~/.bashrc \
44+
# install python
45+
&& CONFIGURE_OPTS=--enable-shared pyenv install $PYTHON_VERSION \
46+
&& pyenv global $PYTHON_VERSION \
47+
&& pip install --upgrade pip \
48+
# install pyinstaller
49+
&& pip install pyinstaller==$PYINSTALLER_VERSION \
50+
&& mkdir /src/ \
51+
&& chmod +x /entrypoint.sh
52+
53+
VOLUME /src/
54+
WORKDIR /src/
55+
56+
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile-py3-bionic-win32

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM ubuntu:bionic
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
5+
ARG WINE_VERSION=stable
6+
ARG PYTHON_VERSION=3.7.9
7+
ARG PYINSTALLER_VERSION=4.0
8+
9+
# we need wine for this all to work, so we'll use the PPA
10+
RUN set -x \
11+
&& dpkg --add-architecture i386 \
12+
&& apt-get update -qy \
13+
&& apt-get install --no-install-recommends -qfy apt-transport-https software-properties-common wget gpg-agent rename \
14+
&& wget -nv https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key \
15+
&& apt-key add Release.key \
16+
&& apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./' \
17+
&& wget -nv https://dl.winehq.org/wine-builds/winehq.key \
18+
&& apt-key add winehq.key \
19+
&& add-apt-repository 'https://dl.winehq.org/wine-builds/ubuntu/' \
20+
&& apt-get update -qy \
21+
&& apt-get install --no-install-recommends -qfy winehq-$WINE_VERSION winbind cabextract \
22+
&& apt-get clean \
23+
&& wget -nv https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
24+
&& chmod +x winetricks \
25+
&& mv winetricks /usr/local/bin
26+
27+
# wine settings
28+
ENV WINEARCH win32
29+
ENV WINEDEBUG fixme-all
30+
ENV WINEPREFIX /wine
31+
32+
# PYPI repository location
33+
ENV PYPI_URL=https://pypi.python.org/
34+
# PYPI index location
35+
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
36+
37+
# install python in wine, using the msi packages to install, extracting
38+
# the files directly, since installing isn't running correctly.
39+
RUN set -x \
40+
&& winetricks win7 \
41+
&& for msifile in `echo core dev exe lib path pip tcltk tools`; do \
42+
wget -nv "https://www.python.org/ftp/python/$PYTHON_VERSION/win32/${msifile}.msi"; \
43+
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python; \
44+
rm ${msifile}.msi; \
45+
done \
46+
&& cd /wine/drive_c/Python \
47+
&& echo 'wine '\''C:\Python\python.exe'\'' "$@"' > /usr/bin/python \
48+
&& echo 'wine '\''C:\Python\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
49+
&& echo 'wine '\''C:\Python\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
50+
&& echo 'wine '\''C:\Python\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
51+
&& echo 'wine '\''C:\Python\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
52+
&& echo 'assoc .py=PythonScript' | wine cmd \
53+
&& echo 'ftype PythonScript=c:\Python\python.exe "%1" %*' | wine cmd \
54+
&& while pgrep wineserver >/dev/null; do echo "Waiting for wineserver"; sleep 1; done \
55+
&& chmod +x /usr/bin/python /usr/bin/easy_install /usr/bin/pip /usr/bin/pyinstaller /usr/bin/pyupdater \
56+
&& (pip install -U pip || true) \
57+
&& rm -rf /tmp/.wine-*
58+
59+
ENV W_DRIVE_C=/wine/drive_c
60+
ENV W_WINDIR_UNIX="$W_DRIVE_C/windows"
61+
ENV W_SYSTEM_DLLS="$W_WINDIR_UNIX/system32"
62+
ENV W_TMP="$W_DRIVE_C/windows/temp/_$0"
63+
64+
# install Microsoft Visual C++ Redistributable for Visual Studio 2017 dll files
65+
RUN set -x \
66+
&& rm -f "$W_TMP"/* \
67+
&& wget -P "$W_TMP" https://download.visualstudio.microsoft.com/download/pr/11687613/88b50ce70017bf10f2d56d60fcba6ab1/VC_redist.x86.exe \
68+
&& cabextract -q --directory="$W_TMP" "$W_TMP"/VC_redist.x86.exe \
69+
&& cabextract -q --directory="$W_TMP" "$W_TMP/a10" \
70+
&& cabextract -q --directory="$W_TMP" "$W_TMP/a11" \
71+
&& cd "$W_TMP" \
72+
&& rename 's/_/\-/g' *.dll \
73+
&& cp "$W_TMP"/*.dll "$W_SYSTEM_DLLS"/
74+
75+
# install pyinstaller
76+
RUN /usr/bin/pip install pyinstaller==$PYINSTALLER_VERSION
77+
78+
# put the src folder inside wine
79+
RUN mkdir /src/ && ln -s /src /wine/drive_c/src
80+
VOLUME /src/
81+
WORKDIR /wine/drive_c/src/
82+
RUN mkdir -p /wine/drive_c/tmp
83+
84+
COPY entrypoint-windows.sh /entrypoint.sh
85+
RUN chmod +x /entrypoint.sh
86+
87+
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile-py3-bionic-win64

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM ubuntu:bionic
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
5+
ARG WINE_VERSION=stable
6+
ARG PYTHON_VERSION=3.7.9
7+
ARG PYINSTALLER_VERSION=4.0
8+
9+
# we need wine for this all to work, so we'll use the PPA
10+
RUN set -x \
11+
&& dpkg --add-architecture i386 \
12+
&& apt-get update -qy \
13+
&& apt-get install --no-install-recommends -qfy apt-transport-https software-properties-common wget gpg-agent rename \
14+
&& wget -nv https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key \
15+
&& apt-key add Release.key \
16+
&& apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./' \
17+
&& wget -nv https://dl.winehq.org/wine-builds/winehq.key \
18+
&& apt-key add winehq.key \
19+
&& add-apt-repository 'https://dl.winehq.org/wine-builds/ubuntu/' \
20+
&& apt-get update -qy \
21+
&& apt-get install --no-install-recommends -qfy winehq-$WINE_VERSION winbind cabextract \
22+
&& apt-get clean \
23+
&& wget -nv https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
24+
&& chmod +x winetricks \
25+
&& mv winetricks /usr/local/bin
26+
27+
# wine settings
28+
ENV WINEARCH win64
29+
ENV WINEDEBUG fixme-all
30+
ENV WINEPREFIX /wine
31+
32+
# PYPI repository location
33+
ENV PYPI_URL=https://pypi.python.org/
34+
# PYPI index location
35+
ENV PYPI_INDEX_URL=https://pypi.python.org/simple
36+
37+
# install python in wine, using the msi packages to install, extracting
38+
# the files directly, since installing isn't running correctly.
39+
RUN set -x \
40+
&& winetricks win7 \
41+
&& for msifile in `echo core dev exe lib path pip tcltk tools`; do \
42+
wget -nv "https://www.python.org/ftp/python/$PYTHON_VERSION/amd64/${msifile}.msi"; \
43+
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python; \
44+
rm ${msifile}.msi; \
45+
done \
46+
&& cd /wine/drive_c/Python \
47+
&& echo 'wine '\''C:\Python\python.exe'\'' "$@"' > /usr/bin/python \
48+
&& echo 'wine '\''C:\Python\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \
49+
&& echo 'wine '\''C:\Python\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \
50+
&& echo 'wine '\''C:\Python\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \
51+
&& echo 'wine '\''C:\Python\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \
52+
&& echo 'assoc .py=PythonScript' | wine cmd \
53+
&& echo 'ftype PythonScript=c:\Python\python.exe "%1" %*' | wine cmd \
54+
&& while pgrep wineserver >/dev/null; do echo "Waiting for wineserver"; sleep 1; done \
55+
&& chmod +x /usr/bin/python /usr/bin/easy_install /usr/bin/pip /usr/bin/pyinstaller /usr/bin/pyupdater \
56+
&& (pip install -U pip || true) \
57+
&& rm -rf /tmp/.wine-*
58+
59+
ENV W_DRIVE_C=/wine/drive_c
60+
ENV W_WINDIR_UNIX="$W_DRIVE_C/windows"
61+
ENV W_SYSTEM64_DLLS="$W_WINDIR_UNIX/system32"
62+
ENV W_TMP="$W_DRIVE_C/windows/temp/_$0"
63+
64+
# install Microsoft Visual C++ Redistributable for Visual Studio 2017 dll files
65+
RUN set -x \
66+
&& rm -f "$W_TMP"/* \
67+
&& wget -P "$W_TMP" https://download.visualstudio.microsoft.com/download/pr/11100230/15ccb3f02745c7b206ad10373cbca89b/VC_redist.x64.exe \
68+
&& cabextract -q --directory="$W_TMP" "$W_TMP"/VC_redist.x64.exe \
69+
&& cabextract -q --directory="$W_TMP" "$W_TMP/a10" \
70+
&& cabextract -q --directory="$W_TMP" "$W_TMP/a11" \
71+
&& cd "$W_TMP" \
72+
&& rename 's/_/\-/g' *.dll \
73+
&& cp "$W_TMP"/*.dll "$W_SYSTEM64_DLLS"/
74+
75+
# install pyinstaller
76+
RUN /usr/bin/pip install pyinstaller==$PYINSTALLER_VERSION
77+
78+
# put the src folder inside wine
79+
RUN mkdir /src/ && ln -s /src /wine/drive_c/src
80+
VOLUME /src/
81+
WORKDIR /wine/drive_c/src/
82+
RUN mkdir -p /wine/drive_c/tmp
83+
84+
COPY entrypoint-windows.sh /entrypoint.sh
85+
RUN chmod +x /entrypoint.sh
86+
87+
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile-py3-focal-amd64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:focal
22
SHELL ["/bin/bash", "-i", "-c"]
33

44
ARG PYTHON_VERSION=3.7.9

Dockerfile-py3-precise-amd64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:12.04
1+
FROM ubuntu:precise
22
SHELL ["/bin/bash", "-i", "-c"]
33

44
ARG PYTHON_VERSION=3.7.9

Dockerfile-py3-precise-i386

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM i386/ubuntu:12.04
1+
FROM i386/ubuntu:precise
22
SHELL ["/bin/bash", "-i", "-c"]
33

44
ARG PYTHON_VERSION=3.7.9

0 commit comments

Comments
 (0)