diff --git a/docker/build/fedora-41/Dockerfile b/docker/build/fedora-41/Dockerfile new file mode 100644 index 000000000..9dcfdf3cd --- /dev/null +++ b/docker/build/fedora-41/Dockerfile @@ -0,0 +1,65 @@ +# The base image +FROM fedora:41 + +# Set environment variables +ENV DIST_NAME=fedora-41 +ENV USER=wxpy +ENV HOME=/home/$USER +ENV PYTHONUNBUFFERED=1 +ENV PATH=$HOME/bin:/usr/bin:$PATH +ENV GTK2_OK=no + +# Update and install basic OS packages +RUN \ + dnf -y update; \ + dnf -y group install "Development Tools"; \ + dnf -y install gcc-c++ sudo nano which; \ +# Set up a user, and etc. + mkdir -p /dist; \ + adduser -m -s /usr/bin/bash ${USER}; \ + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ + mkdir -p ${HOME}/bin; \ +# Install development packages needed for building wxPython + dnf install -y \ + freeglut-devel \ + gstreamer1-devel \ + gstreamer1-plugins-base-devel \ + gtk3-devel \ + libjpeg-turbo-devel \ + libnotify-devel \ + libpng-devel \ + libSM-devel \ + libtiff-devel \ + libXtst-devel \ + SDL2-devel \ + webkit2gtk3-devel; + +RUN \ +# Install all available Python packages and their dev packages + dnf -y install python3 python3-devel; \ + dnf -y install python3.14 python3.14-devel; + +RUN \ +# Clean up dnf caches + dnf clean all; + +# Set the working directory +WORKDIR ${HOME} + +# Create virtual environments for each Python +RUN \ + cd ${HOME}; \ + mkdir -p ${HOME}/venvs; \ + python3.13 -m venv ${HOME}/venvs/Py313; \ + python3.14 -m venv ${HOME}/venvs/Py314; \ + chown -R ${USER}:${USER} ${HOME}; + +# Add files from host into the container +COPY ./scripts/* ${HOME}/bin + +# Set the user and group to use for the rest of the commands +USER ${USER}:${USER} + +# Define default command +CMD ["/usr/bin/bash", "-l"] + diff --git a/docker/gui/fedora-41/Dockerfile b/docker/gui/fedora-41/Dockerfile new file mode 100644 index 000000000..0ab267729 --- /dev/null +++ b/docker/gui/fedora-41/Dockerfile @@ -0,0 +1,26 @@ +FROM wxpython4/build:fedora-41 + +RUN sudo dnf -y install tigervnc-server xterm +RUN mkdir ~/.vnc + +# RUN sudo dnf -y install fluxbox +# RUN echo "fluxbox &"> ~/.vnc/xstartup + +# RUN sudo dnf -y install @xfce-desktop-environment +# RUN echo "startxfce4 &"> ~/.vnc/xstartup + +RUN sudo dnf -y install --allowerasing @mate-desktop-environment +RUN echo "mate-session &"> ~/.vnc/xstartup + +# RUN sudo dnf -y install @lxde-desktop-environment +# RUN echo "startlxde &"> ~/.vnc/xstartup + +RUN sudo dnf -y remove *screensaver* +RUN sudo dnf clean all + +RUN chmod u+x ~/.vnc/xstartup +RUN echo "password" | vncpasswd -f >> ~/.vnc/passwd +RUN chmod 600 ~/.vnc/passwd +RUN touch ~/.Xauthority + +CMD ["start-vncserver.sh"] diff --git a/docker/tasks.py b/docker/tasks.py index aa7e4c0a0..cdbb3238e 100644 --- a/docker/tasks.py +++ b/docker/tasks.py @@ -17,6 +17,9 @@ HERE = os.path.abspath(os.path.dirname(__file__)) +FEDORA_HOST = os.path.exists('/etc/fedora-release') +OPTION_ROOT = '-u root' if FEDORA_HOST else '' +OPTION_SELINUX = ':Z' if FEDORA_HOST else '' # Distros that have been promoted to Emeritus status. They can still be selected # manually, but will be excluded by default when selecting all images. @@ -87,9 +90,9 @@ def test_images(ctx, image, gui=False, include_old=False): img_type = 'gui' if gui else 'build' for img_name in image: # test it - ctx.run('docker run -it --rm -v {}:/dist ' - 'wxpython4/{}:{} hello.sh'.format(dist, img_type, img_name), - pty=True, echo=True) + ctx.run('docker run {} -it --rm -v {}:/dist{} ' + 'wxpython4/{}:{} hello.sh'.format(OPTION_ROOT, dist, OPTION_SELINUX, + img_type, img_name), pty=True, echo=True) @task( @@ -143,9 +146,9 @@ def build_wxpython(ctx, image, venv='all', port='gtk3', include_old=False, keep= dist=os.path.abspath('../dist') rm = '' if keep else '--rm' for img_name in image: - ctx.run('docker run -it {} -v {}:/dist ' - 'wxpython4/build:{} do-build.sh {} {}'.format(rm, dist, img_name, venv, port), - pty=True, echo=True) + ctx.run('docker run {} -it {} -v {}:/dist{} ' + 'wxpython4/build:{} do-build.sh {} {}'.format(OPTION_ROOT, rm, dist, + OPTION_SELINUX, img_name, venv, port), pty=True, echo=True) @task( @@ -168,9 +171,8 @@ def run(ctx, image_tag, cmd=None, gui=False, port=5901, keep=False): cmd = '' if cmd is None else cmd rm = '' if keep else '--rm' ctx.run( - 'docker run -it {} -v {}:/dist -p {}:5901 wxpython4/{}:{} {}'.format( - rm, dist, port, imgtype, image_tag, cmd), - pty=True, echo=True) + 'docker run {} -it {} -v {}:/dist{} -p {}:5901 wxpython4/{}:{} {}'.format(OPTION_ROOT, + rm, dist, OPTION_SELINUX, port, imgtype, image_tag, cmd), pty=True, echo=True) def _get_all_distros(gui=False, include_old=False):