diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c0d6c81 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-2024 Ad5001, 2016 Chris R + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 8e8cb8e..8e195ed 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,28 @@ -# accountfree-docker +# docker-ubuntu-pyside-xvfb --- -This repository contains the Dockerfiles required to build AccountFree: -- ubuntu-pyside6-xvfb: Ubuntu jammy base containing PySide6 (Qt for Python) & Xvfb (virtual X server that does not require a display). -- ubuntu-pyside6-xvfb-wine: Contains the latest wine installation, with Windows python3, PySide6 & pyinstaller + Xvfb. -- ubuntu-pyside2-xvfb: Ubuntu focal base containing PySide2 (Qt for Python) & Xvfb (virtual X server that does not require a display). -- ubuntu-pyside2-xvfb-wine: Contains the latest wine installation, with Windows python3, PySide2 & pyinstaller + Xvfb. -- accountfree-build-img: Based on ubuntu-pyside2-xvfb, contains AccountFree dependencies to build it's Linux packages. -- accountfree-build-img: Based on ubuntu-pyside2-xvfb-wine, contains AccountFree dependencies to build it's Windows installer. +This repository contains the Dockerfiles required to build all tags on [Docker Hub](https://hub.docker.com/repository/docker/ad5001/ubuntu-pyside-xvfb/): + +All tags come with: + +- a version of Python (v3.12 for PySide6, v3.10 for PySide2) +- the tagged version of PySide2/6. +- Python packages: `pip`, `requests`, `packaging`, `pytest` (+ `pytest-cov` + `pytest-qt`) +- `xvfb`, `xdotool`, and `wmctrl`. + +The linux tags have the following: +- a Ubuntu base (noble for PySide6 and jammy for PySide2) +- python3 is available under `/usr/bin/python3`. +- External pip management disabled (allows you to install packages from pip directly). +- `make`, `git`, `rpm`, and `dh-python`. + +The wine tags have the following: +- The latest `winehq-staging` under a Ubuntu base. +- `/usr/bin/python` calling `python3` under wine. +- `/usr/bin/pip` calling `pip` under wine. +- `/usr/bin/pyinstaller` calling `pyinstaller` under wine. +- `wget`, `curl`, `git`, `p7zip-full`, `unzip` and `nsis`. + +Additionally, the LaTeX linux tag include a full TeXlive installation including `dvipng` and the latex extras. NOTE: In Docker, use xvfb-run to run a program within a Xvfb server. diff --git a/accountfree-build-img-wine/Dockerfile b/accountfree-build-img-wine/Dockerfile deleted file mode 100644 index 640086b..0000000 --- a/accountfree-build-img-wine/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ad5001/ubuntu-pyside2-xvfb-wine:win7-5.15.2 - -RUN apt-get update \ - && apt install unzip nsis curl -y -RUN apt clean -# Installing tor -RUN wget https://dist.torproject.org/torbrowser/10.5.4/tor-win64-0.4.5.9.zip \ - && ls -la \ - && unzip tor-win64-0.4.5.9.zip -x Data/* \ - && rm tor-win64-0.4.5.9.zip \ - && mv Tor /wine/drive_c/ - -RUN wine reg ADD "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" /v PATH /f /t REG_EXPAND_SZ /d "C:\windows\system32;C:\windows;C:\windows\system32\wbem;C:\Tor" -# Installing dependencies -RUN pip install packaging websocket-client pywin32 stem requests diff --git a/accountfree-build-img/Dockerfile b/accountfree-build-img/Dockerfile deleted file mode 100644 index 1128a4f..0000000 --- a/accountfree-build-img/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM ad5001/ubuntu-pyside2-xvfb:hirsute-5.15.2 - -ARG DEBIAN_FRONTEND=noninteractive - -ENV TZ=Europe/Paris -RUN apt-get update && apt-get upgrade -y \ - && apt-get -y install tor qml-module-qtqml-models2 qml-module-qtquick-controls python3-stdeb python-all python3-requests python3-stem rpm dh-python -RUN pip3 install packaging websocket-client diff --git a/pyside2-linux/Dockerfile b/pyside2-linux/Dockerfile new file mode 100644 index 0000000..1921b41 --- /dev/null +++ b/pyside2-linux/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:jammy # Jammy uses python3.10 and not 3.12, which is not compatible with PySide2. + +ARG DEBIAN_FRONTEND=noninteractive +ARG PYSIDE2_VERSION=5.15.2.1 + +ENV TZ=Europe/Paris +RUN apt-get update +RUN apt-get -y install make git rpm dh-python \ + xvfb xdotool wmctrl \ + python3 python3-pip python3-stdeb python-all python3-requests python3-packaging python3-pip python3-pytest python3-pytest-cov python3-pytestqt \ + qml-module-qtquick-controls2 qml-module-qtmultimedia qml-module-qtgraphicaleffects qml-module-qtquick2 qml-module-qtqml-models2 qml-module-qtquick-controls +RUN rm /usr/lib/python3.*/EXTERNALLY-MANAGED # Disable managed environment. We don't care about breaking system packages here. +RUN python3 -m pip install PySide2==$PYSIDE2_VERSION +RUN apt clean diff --git a/ubuntu-pyside2-xvfb-wine/Dockerfile b/pyside2-wine/Dockerfile similarity index 73% rename from ubuntu-pyside2-xvfb-wine/Dockerfile rename to pyside2-wine/Dockerfile index 5e6b44a..bf54c47 100644 --- a/ubuntu-pyside2-xvfb-wine/Dockerfile +++ b/pyside2-wine/Dockerfile @@ -1,14 +1,14 @@ -FROM ubuntu:jammy +FROM ubuntu:noble ARG PYSIDE2_VERSION=5.15.2.1 -# Adapted rom https://github.com/cdrx/docker-pyinstaller/blob/master/Dockerfile-py3-win64 -# Unupdated for a while. +# Adapted from https://github.com/cdrx/docker-pyinstaller/blob/master/Dockerfile-py3-win64 +# Upstream hasn't been updated for a while. ENV DEBIAN_FRONTEND noninteractive ARG WINE_VERSION=winehq-staging -ARG PYTHON_VERSION=3.9.6 +ARG PYTHON_VERSION=3.10.15 # Python3.10 are the last supported version of Python for PySide2. ARG PYINSTALLER_VERSION=5.0.1 # we need wine for this all to work, so we'll use the PPA @@ -41,17 +41,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:/Python39; \ + wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/Python310; \ rm ${msifile}.msi; \ done \ - && 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 \ + && cd /wine/drive_c/Python310 \ + && echo 'wine '\''C:\Python310\python.exe'\'' "$@"' > /usr/bin/python \ + && echo 'wine '\''C:\Python310\Scripts\easy_install.exe'\'' "$@"' > /usr/bin/easy_install \ + && echo 'wine '\''C:\Python310\Scripts\pip.exe'\'' "$@"' > /usr/bin/pip \ + && echo 'wine '\''C:\Python310\Scripts\pyinstaller.exe'\'' "$@"' > /usr/bin/pyinstaller \ + && echo 'wine '\''C:\Python310\Scripts\pyupdater.exe'\'' "$@"' > /usr/bin/pyupdater \ && echo 'assoc .py=PythonScript' | wine cmd \ - && echo 'ftype PythonScript=c:\Python39\python.exe "%1" %*' | wine cmd \ + && echo 'ftype PythonScript=c:\Python310\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) \ @@ -75,7 +75,7 @@ RUN set -x \ # Additional data for PySide2 -RUN apt install -y wget curl p7zip-full git xvfb +RUN apt install -y wget curl p7zip-full git unzip nsis xvfb xdotool wmctrl RUN apt clean # Installing pyside2 & pyinstaller -RUN pip install wheel PySide2==$PYSIDE2_VERSION pyinstaller==$PYINSTALLER_VERSION +RUN pip install wheel PySide2==$PYSIDE2_VERSION pyinstaller==$PYINSTALLER_VERSION requests pytest pytest-cov pytest-qt packaging diff --git a/pyside6-linux-latex/Dockerfile b/pyside6-linux-latex/Dockerfile new file mode 100644 index 0000000..ba7554e --- /dev/null +++ b/pyside6-linux-latex/Dockerfile @@ -0,0 +1,6 @@ +FROM ad5001/ubuntu-pyside-xvfb:linux-6.7.2 + +ENV TZ=Europe/Paris +RUN apt-get update +RUN apt-get -y install texlive-base dvipng texlive-latex-extra +RUN apt clean diff --git a/ubuntu-pyside6-xvfb/Dockerfile b/pyside6-linux/Dockerfile similarity index 54% rename from ubuntu-pyside6-xvfb/Dockerfile rename to pyside6-linux/Dockerfile index 4c855e2..7a677c6 100644 --- a/ubuntu-pyside6-xvfb/Dockerfile +++ b/pyside6-linux/Dockerfile @@ -5,7 +5,9 @@ ARG PYSIDE2_VERSION=6.7.2 ENV TZ=Europe/Paris RUN apt-get update -RUN apt-get -y install make git python3-pip python3-pytest python3-pytest-cov python3-pytestqt xvfb xdotool wmctrl libxcb-cursor0 +RUN apt-get -y install make git rpm dh-python \ + xvfb xdotool wmctrl \ + python3 python3-pip python3-stdeb python-all python3-requests python3-packaging python3-pip python3-pytest python3-pytest-cov python3-pytestqt RUN rm /usr/lib/python3.*/EXTERNALLY-MANAGED # Disable managed environment. We don't care about breaking system packages here. RUN python3 -m pip install PySide6==$PYSIDE2_VERSION RUN apt clean diff --git a/ubuntu-pyside6-xvfb-wine/Dockerfile b/pyside6-wine/Dockerfile similarity index 96% rename from ubuntu-pyside6-xvfb-wine/Dockerfile rename to pyside6-wine/Dockerfile index 4eb87ff..1639523 100644 --- a/ubuntu-pyside6-xvfb-wine/Dockerfile +++ b/pyside6-wine/Dockerfile @@ -75,7 +75,7 @@ RUN set -x \ # Additional data for PySide6 -RUN apt install -y wget curl p7zip-full git xvfb unzip nsis +RUN apt install -y wget curl p7zip-full git unzip nsis xvfb xdotool wmctrl RUN apt clean # Installing pyside6 & pyinstaller -RUN pip install wheel PySide6==$PYSIDE2_VERSION pyinstaller==$PYINSTALLER_VERSION pytest +RUN pip install wheel PySide6==$PYSIDE2_VERSION pyinstaller==$PYINSTALLER_VERSION requests pytest pytest-cov pytest-qt packaging diff --git a/ubuntu-pyside2-xvfb/Dockerfile b/ubuntu-pyside2-xvfb/Dockerfile deleted file mode 100644 index 8b34f02..0000000 --- a/ubuntu-pyside2-xvfb/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:jammy - -ARG DEBIAN_FRONTEND=noninteractive -ARG PYSIDE2_VERSION=5.15.2.1 - -ENV TZ=Europe/Paris -RUN apt-get update -RUN apt-get -y install make git python3-pip qml-module-qtquick-controls2 qml-module-qtmultimedia qml-module-qtgraphicaleffects qml-module-qtquick2 xvfb xdotool wmctrl -RUN python3 -m pip install PySide2==$PYSIDE2_VERSION -RUN apt clean