Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2025 Northwestern University.
#
# Documentation: https://docs.github.com/en/code-security/dependabot

version: 2
updates:

# Enable version updates for GitHub actions
- package-ecosystem: "github-actions"
# Exception as per documentation: "/" means to look for any files in `.github/workfows/`
Comment thread
fenekku marked this conversation as resolved.
Outdated
directory: "/"
# Check for updates once a week on Monday
schedule:
interval: "weekly"
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,51 @@

Comment thread
fenekku marked this conversation as resolved.
[![Build Status](https://github.com/inveniosoftware/docker-invenio/workflows/CI/badge.svg)](https://github.com/inveniosoftware/docker-invenio/actions)

This image serves as base image, usable in production environments like Kubernetes or OpenShift, for:
This repository defines the Dockerfiles for the foundational Docker images usable in production environments like Docker Compose, Kubernetes, OpenShift, or other container orchestrator.
Comment thread
fenekku marked this conversation as resolved.
Outdated
These Dockerfiles are for any Invenio-based app:
* [InvenioRDM](https://github.com/inveniosoftware/invenio-app-rdm)
* [InvenioILS](https://github.com/inveniosoftware/invenio-app-ils)
* [Invenio](https://github.com/inveniosoftware/invenio)

Previous images, still available in this repository for reference only, were based on `CentOS`: after the [shift from CentOS to CentOS Stream](https://blog.centos.org/2020/12/future-is-centos-stream/), the main image is now based on [AlmaLinux](https://almalinux.org/), a free alternative downstream rebuild of Red Hat Enterprise Edition.
## Provided images

The provided images are the ones supported by CERN and/or an Invenio partner organization.

The [current image](almalinux/Dockerfile) is based on the AlmaLinux version 9 and contains:
| Operating System | Dockerfile FROM | Supporting organization |
| ----------------- | ------------------------------------------------- | ---------------------------------------------------------- |
| AlmaLinux - v9 | FROM registry.cern.ch/inveniosoftware/almalinux:1 | CERN (@ntarocco) |
| Debian - bookworm | FROM TBD | Northwestern University (@fenekku), Frontmatter (@mfenner) |
Comment thread
fenekku marked this conversation as resolved.
Outdated
| | | |

- Python v3.9 set as default Python interpreter with upgraded versions of pip, pipenv, setuptools and wheel.
- Node.js v22.x
- Working directory for an Invenio instance.
All images provide a common baseline of:
- Python version
Comment thread
fenekku marked this conversation as resolved.
Outdated
- Node and NPM version
- development headers for all Invenio dependencies
- "invenio" user with uid 1000
- /opt/invenio/ working directory and appropriate subdirectories

Images are currently published in the CERN registry `registry.cern.ch`.
Previous images, still available in this repository for reference only, were based on `CentOS`: after the [shift from CentOS to CentOS Stream](https://blog.centos.org/2020/12/future-is-centos-stream/), the main image is now based on [AlmaLinux](https://almalinux.org/), a free alternative downstream rebuild of Red Hat Enterprise Edition.

## Usage

### Create a ``Dockerfile``

A simple ``Dockerfile`` using this base image could look like this:
Your own simple ``Dockerfile`` using one of the base image would look like this:

```
FROM registry.cern.ch/inveniosoftware/almalinux:latest
```dockerfile
# Select the FROM line, you want. For AlmaLinux, it would be:
FROM registry.cern.ch/inveniosoftware/almalinux:1
```

### Rolling builds
### Build and run the Docker image

The images are rebuilt when the base images are updated. The base image are receiving regular monthly
updates as well as emergency fixes.
To test the Docker image locally, you can build it and run it by doing:

### Local builds

To test the Dockerimage locally, you can build it and run it by doing:

```
cd almalinux
docker build . -t almalinux:1
docker run -it almalinux:1 /bin/bash
```bash
docker build . -t my-image:1
docker run -it my-image:1 /bin/bash
```

## Optimization

You can use a tool like [dive](https://github.com/wagoodman/dive) to explore the layers of the Docker images and optimize it.
You can use a tool like [dive](https://github.com/wagoodman/dive) to explore the layers of the Docker images and optimize it in your own Dockerfile.
77 changes: 77 additions & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# syntax=docker/dockerfile:1

#
# Copyright (C) 2026 Northwestern University.
# Copyright (C) 2026 Frontmatter.
#
# 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 BUILD_PLATFORM=linux/amd64
ARG PYTHON_VERSION=3.14
ARG OS_VERSION=trixie
ARG NODE_VERSION=22

FROM --platform=${BUILD_PLATFORM} python:${PYTHON_VERSION}-${OS_VERSION}

LABEL org.opencontainers.image.source=https://github.com/inveniosoftware/docker-invenio

# Create relevant application directories
ENV \
WORKING_DIR=/opt/invenio \
INVENIO_INSTANCE_PATH=/opt/invenio/var/instance \
INVENIO_USER_ID=1000
Comment thread
fenekku marked this conversation as resolved.
Outdated

RUN mkdir -p \
${WORKING_DIR}/src \
${INVENIO_INSTANCE_PATH}/data \
${INVENIO_INSTANCE_PATH}/archive \
${INVENIO_INSTANCE_PATH}/static

# Invenio file will be in <WORKING_DIR>/src
WORKDIR ${WORKING_DIR}/src

# Set folder permissions
RUN chgrp -R 0 ${WORKING_DIR} && \
chmod -R g=u ${WORKING_DIR} && \
useradd invenio --uid ${INVENIO_USER_ID} --gid 0 && \
chown -R invenio:root ${WORKING_DIR}

RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& \
# Install dependencies
apt-get install --yes --no-install-recommends \
git \
gcc \
locales \
build-essential \
fonts-dejavu \
imagemagick \
libbz2-dev \
libcairo2 \
libffi-dev \
liblzma-dev \
libpq-dev \
libssl-dev \
libsqlite3-dev \
libxml2-dev \
libxslt1-dev \
&& \
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
Comment thread
fenekku marked this conversation as resolved.
Outdated
&& \
apt-get install --yes --no-install-recommends nodejs npm

# Set locale
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV \
LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8

# Install/update Python tooling
RUN pip install --upgrade pip pipenv wheel