Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/publish-almalinux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ inputs:
docker-labels:
description: Docker image labels
required: true
python-version:
description: Version of python to install
required: true

runs:
using: 'composite'
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/publish-almalinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
name: Publish AlmaLinux
runs-on: ubuntu-latest

# Prepare the ground to have multiple python versions. Note that this should be passed to the
# underlying image
strategy:
matrix:
python: ["3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -34,7 +40,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: registry.cern.ch/${{ github.repository_owner }}/almalinux
images: registry.cern.ch/${{ github.repository_owner }}/almalinux-${{ matrix.python }}
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
Expand All @@ -47,6 +53,7 @@ jobs:
- name: Publish AlmaLinux
uses: ./.github/actions/publish-almalinux
with:
python-version: ${{ matrix.python }}
registry-username: ${{ secrets.CERN_REGISTRY_USERNAME }}
registry-password: ${{ secrets.CERN_REGISTRY_PASSWORD }}
docker-tags: ${{ steps.meta.outputs.tags }}
Expand Down
24 changes: 19 additions & 5 deletions almalinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,24 @@
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
ARG LINUX_VERSION=9.3
ARG PYTHON_VERSION=3.12
ARG LINUX_VERSION=9
ARG NODEJS_VERSION=22
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM almalinux:${LINUX_VERSION}

ARG PYTHON_VERSION
RUN dnf install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-devel python${PYTHON_VERSION}-pip\
&& dnf clean all

ARG PYTHON_VERSION
RUN python${PYTHON_VERSION} -m pip install --upgrade pip setuptools wheel

# Symlink Python
ARG PYTHON_VERSION
RUN ln -sfn /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python3 && \
ln -sfn /usr/bin/pip${PYTHON_VERSION} /usr/local/bin/pip3

RUN dnf upgrade --refresh -y && \
dnf install -y \
dnf-plugins-core \
Expand All @@ -28,9 +42,10 @@ ENV LC_ALL=en_US.UTF-8

# EPEL: Extra Packages for Enterprise Linux 9
# `epel-release` is not recent/complete enough, as some packages below are missing
ARG LINUX_VERSION
RUN dnf config-manager --set-enabled crb && \
dnf install -y \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
https://dl.fedoraproject.org/pub/epel/epel-release-latest-${LINUX_VERSION}.noarch.rpm

# Install needed and useful tools:
# - python and friends
Expand Down Expand Up @@ -60,14 +75,13 @@ RUN dnf install -y \
iotop iftop \
tcpdump bind-utils

# Symlink Python
RUN ln -sfn /usr/bin/python3 /usr/bin/python
# `python3-packaging` is installed by `yum` and it causes issues with `pip` installations
RUN yum remove python3-packaging -y
RUN pip3 install --upgrade pip pipenv wheel

# Install Node.js
RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
ARG NODEJS_VERSION
RUN curl -fsSL https://rpm.nodesource.com/setup_${NODEJS_VERSION}.x | bash - && \
dnf -y install nodejs

# Reduce image size: clean up caches, remove RPM db files
Expand Down