77# Invenio is free software; you can redistribute it and/or modify it
88# under the terms of the MIT License; see LICENSE file for more details.
99#
10- ARG LINUX_VERSION=9.3
10+ ARG PYTHON_VERSION=3.12
11+ ARG LINUX_VERSION=9
12+ ARG NODEJS_VERSION=22
1113ARG BUILDPLATFORM=linux/amd64
1214FROM --platform=$BUILDPLATFORM almalinux:${LINUX_VERSION}
1315
16+ ARG PYTHON_VERSION
17+ RUN dnf install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-devel python${PYTHON_VERSION}-pip\
18+ && dnf clean all
19+
20+ ARG PYTHON_VERSION
21+ RUN python${PYTHON_VERSION} -m pip install --upgrade pip setuptools wheel
22+
23+ # Symlink Python
24+ ARG PYTHON_VERSION
25+ RUN ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python3 && \
26+ ln -sfn /usr/bin/pip${PYTHON_VERSION} /usr/local/bin/pip3
27+
1428RUN dnf upgrade --refresh -y && \
1529 dnf install -y \
1630 dnf-plugins-core \
@@ -28,9 +42,10 @@ ENV LC_ALL=en_US.UTF-8
2842
2943# EPEL: Extra Packages for Enterprise Linux 9
3044# `epel-release` is not recent/complete enough, as some packages below are missing
45+ ARG LINUX_VERSION
3146RUN dnf config-manager --set-enabled crb && \
3247 dnf install -y \
33- https://dl.fedoraproject.org/pub/epel/epel-release-latest-9 .noarch.rpm
48+ https://dl.fedoraproject.org/pub/epel/epel-release-latest-${LINUX_VERSION} .noarch.rpm
3449
3550# Install needed and useful tools:
3651# - python and friends
@@ -60,14 +75,13 @@ RUN dnf install -y \
6075 iotop iftop \
6176 tcpdump bind-utils
6277
63- # Symlink Python
64- RUN ln -sfn /usr/bin/python3 /usr/bin/python
6578# `python3-packaging` is installed by `yum` and it causes issues with `pip` installations
6679RUN yum remove python3-packaging -y
6780RUN pip3 install --upgrade pip pipenv wheel
6881
6982# Install Node.js
70- RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
83+ ARG NODEJS_VERSION
84+ RUN curl -fsSL https://rpm.nodesource.com/setup_${NODEJS_VERSION}.x | bash - && \
7185 dnf -y install nodejs
7286
7387# Reduce image size: clean up caches, remove RPM db files
0 commit comments