|
| 1 | +# The base image |
| 2 | +FROM rockylinux:8 |
| 3 | + |
| 4 | +# Set environment variables |
| 5 | +ENV DIST_NAME=rocky-8 |
| 6 | +ENV USER=wxpy |
| 7 | +ENV HOME=/home/$USER |
| 8 | +ENV PYTHONUNBUFFERED=1 |
| 9 | +ENV PATH=$HOME/bin:$PATH |
| 10 | +ENV GTK2_OK=no |
| 11 | + |
| 12 | + |
| 13 | +# Update and install basic OS packages |
| 14 | +RUN \ |
| 15 | +# yum -y install https://centos8.iuscommunity.org/ius-release.rpm; \ |
| 16 | +# yum install \ |
| 17 | +# https://repo.ius.io/ius-release-el8.rpm \ |
| 18 | +# https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm; \ |
| 19 | +# dnf config-manager --set-enabled PowerTools; \ |
| 20 | + yum -y update; \ |
| 21 | + yum -y group install development; \ |
| 22 | + yum -y install sudo nano which; \ |
| 23 | +# Set up a user, and etc. |
| 24 | + mkdir -p /dist; \ |
| 25 | + adduser -m ${USER}; \ |
| 26 | + echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers; \ |
| 27 | +# Install development packages needed for building wxPython |
| 28 | + yum -y install \ |
| 29 | + freeglut-devel \ |
| 30 | + gstreamer1-devel \ |
| 31 | + gstreamer1-plugins-base-devel \ |
| 32 | + gtk3-devel \ |
| 33 | + libjpeg-turbo-devel \ |
| 34 | + libnotify \ |
| 35 | + libnotify-devel \ |
| 36 | + libpng-devel \ |
| 37 | + libSM-devel \ |
| 38 | + libtiff-devel \ |
| 39 | + libXtst-devel \ |
| 40 | + SDL-devel \ |
| 41 | + webkit2gtk3-devel; \ |
| 42 | +# Install all available Python packages and their dev packages |
| 43 | + yum -y install python3 python3-tools python3-devel; \ |
| 44 | + yum -y install python38 python38-devel; \ |
| 45 | + yum -y install python39 python39-devel; \ |
| 46 | +# Clean up the yum caches |
| 47 | + yum clean all; |
| 48 | + |
| 49 | +# Set the user and group to use for the rest of the commands |
| 50 | +USER ${USER}:${USER} |
| 51 | + |
| 52 | +# Set the working directory |
| 53 | +WORKDIR ${HOME} |
| 54 | + |
| 55 | +# Create virtual environments for each Python |
| 56 | +RUN \ |
| 57 | + cd ${HOME}; \ |
| 58 | + mkdir -p ${HOME}/venvs; \ |
| 59 | + python3.8 -m venv venvs/Py38; \ |
| 60 | + python3.9 -m venv venvs/Py39; |
| 61 | + |
| 62 | +# Add files from host into the container |
| 63 | +COPY scripts ${HOME}/bin |
| 64 | + |
| 65 | +# Define default command |
| 66 | +CMD ["/bin/bash", "-l"] |
| 67 | + |
0 commit comments