ci: use package-manager dependency install scripts

Currently, adding a package which is required either for development or testing
requires it to be added in multiple places due to many duplicated Dockerfiles
and installation scripts. This makes it difficult to ensure that all scripts
are updated appropriately and can lead to some places being missed.

This patch consolidates the list of dependencies and adds installation
scripts for each package-manager used in our CI (apk, apt, dnf, pacman).

This change also replaces the `debian/dev-packages.lst` as this subfolder
conflicts with the Ubuntu/Debian packing scripts used for CRIU:
https://github.com/rst0git/criu-deb-packages

This patch also removes the CentOS 8 build scripts as it is EOL
and the container registry is no longer available.

Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Shashank Balaji 2025-09-17 19:14:36 +09:00 committed by Andrei Vagin
parent 67751bc11b
commit 25f8be0f60
35 changed files with 295 additions and 459 deletions

View file

@ -1,49 +1,12 @@
FROM alpine
ARG CC=gcc
RUN apk update && apk add \
$CC \
bash \
build-base \
coreutils \
procps \
git \
gnutls-dev \
libaio-dev \
libcap-dev \
libnet-dev \
libnl3-dev \
nftables \
nftables-dev \
pkgconfig \
protobuf-c-dev \
protobuf-dev \
py3-pip \
py3-protobuf \
python3 \
sudo \
libcap-utils \
libdrm-dev \
util-linux \
util-linux-dev
COPY . /criu
WORKDIR /criu
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
RUN apk add \
ip6tables \
iptables \
iptables-legacy \
nftables \
iproute2 \
tar \
bash \
go \
e2fsprogs \
py-yaml \
py3-importlib-metadata \
asciidoctor
RUN apk add --no-cache "$CC" && /criu/contrib/dependencies/apk-packages.sh
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
# The rpc test cases are running as user #1000, let's add the user
RUN adduser -u 1000 -D test

View file

@ -5,40 +5,11 @@ ARG CC=gcc
# Initialize machine ID
RUN systemd-machine-id-setup
RUN pacman -Syu --noconfirm \
$CC \
bash \
make \
coreutils \
git \
gnutls \
libaio \
libcap \
libnet \
libnl \
nftables \
pkgconfig \
protobuf-c \
protobuf \
python-pip \
python-protobuf \
which \
sudo \
iptables \
nftables \
iproute2 \
tar \
bash \
go \
python-yaml \
asciidoctor \
python-importlib-metadata \
libdrm \
util-linux-libs \
diffutils
COPY . /criu
WORKDIR /criu
RUN pacman -Syu --noconfirm "$CC" && contrib/dependencies/pacman-packages.sh
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
# The rpc test cases are running as user #1000, let's add the user

View file

@ -1,48 +0,0 @@
FROM registry.centos.org/centos/centos:8
ARG CC=gcc
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm dnf-plugins-core
RUN yum config-manager --set-enabled powertools
RUN yum install -y --allowerasing \
asciidoc \
coreutils \
chkconfig \
diffutils \
findutils \
gcc \
git \
gnutls-devel \
iproute \
iptables \
libaio-devel \
libasan \
libcap-devel \
libnet-devel \
libnl3-devel \
libselinux-devel \
make \
procps-ng \
protobuf-c-devel \
protobuf-devel \
python3-devel \
python3-PyYAML \
python3-protobuf \
python3-pip \
sudo \
tar \
which \
xmlto
RUN alternatives --set python /usr/bin/python3
ENV PYTHON=python3
COPY . /criu
WORKDIR /criu
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
# The rpc test cases are running as user #1000, let's add the user
RUN adduser -u 1000 test
RUN make -C test/zdtm -j $(nproc)

View file

@ -1,11 +1,10 @@
ARG CC=gcc
COPY scripts/ci/prepare-for-fedora-rawhide.sh /bin/prepare-for-fedora-rawhide.sh
RUN /bin/prepare-for-fedora-rawhide.sh
COPY . /criu
WORKDIR /criu
RUN dnf install -y "$CC" && scripts/ci/prepare-for-fedora-rawhide.sh
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
# The rpc test cases are running as user #1000, let's add the user

View file

@ -1,30 +1,11 @@
FROM docker.io/library/eclipse-temurin:11-alpine
ARG CC=gcc
RUN apk update && apk add \
bash \
build-base \
coreutils \
git \
gnutls-dev \
libaio-dev \
libcap-dev \
libnet-dev \
libnl3-dev \
pkgconfig \
protobuf-c-dev \
protobuf-dev \
python3 \
sudo \
maven \
ip6tables \
iptables \
util-linux-dev \
bash
COPY . /criu
WORKDIR /criu
RUN apk add --no-cache maven "$CC" && contrib/dependencies/apk-packages.sh
RUN make mrproper && make -j $(nproc) CC="$CC"
ENTRYPOINT mvn -q -f test/javaTests/pom.xml test
ENTRYPOINT ["mvn", "-q", "-f", "test/javaTests/pom.xml", "test"]

View file

@ -1,33 +1,11 @@
FROM docker.io/library/eclipse-temurin:11-focal
ARG CC=gcc
COPY scripts/ci/apt-install /bin/apt-install
RUN apt-install protobuf-c-compiler \
libprotobuf-c-dev \
libaio-dev \
libprotobuf-dev \
protobuf-compiler \
libcap-dev \
libnl-3-dev \
gdb \
bash \
python3-protobuf \
python3-yaml \
libnet-dev \
libnl-route-3-dev \
libbsd-dev \
make \
git \
pkg-config \
iptables \
gcc \
uuid-dev \
maven
COPY . /criu
WORKDIR /criu
RUN contrib/apt-install maven "$CC" && contrib/dependencies/apt-packages.sh
RUN make mrproper && make -j $(nproc) CC="$CC"
ENTRYPOINT mvn -q -f test/javaTests/pom.xml test
ENTRYPOINT ["mvn", "-q", "-f", "test/javaTests/pom.xml", "test"]

View file

@ -1,32 +1,10 @@
ARG CC=gcc
COPY scripts/ci/apt-install /bin/apt-install
RUN apt-install \
libnet-dev \
libnl-route-3-dev \
$CC \
bsdmainutils \
build-essential \
git-core \
iptables \
libaio-dev \
libcap-dev \
libgnutls28-dev \
libgnutls30 \
libnl-3-dev \
libprotobuf-c-dev \
libprotobuf-dev \
libselinux-dev \
pkg-config \
protobuf-c-compiler \
protobuf-compiler \
uuid-dev \
python3-minimal
COPY . /criu
WORKDIR /criu
RUN contrib/apt-install "$CC" && contrib/dependencies/apt-packages.sh
RUN uname -m && setarch linux32 uname -m && setarch --list
RUN make mrproper && date && \

View file

@ -1,34 +1,12 @@
FROM docker.io/library/ibm-semeru-runtimes:open-11-jdk-focal
ARG CC=gcc
COPY scripts/ci/apt-install /bin/apt-install
RUN apt-install protobuf-c-compiler \
libprotobuf-c-dev \
libaio-dev \
libprotobuf-dev \
protobuf-compiler \
libcap-dev \
libnl-3-dev \
gdb \
bash \
python3-protobuf \
python3-yaml \
libnet-dev \
libnl-route-3-dev \
libbsd-dev \
make \
git \
pkg-config \
iptables \
gcc \
uuid-dev \
maven
RUN mkdir -p /etc/criu && echo 'ghost-limit 16777216' > /etc/criu/default.conf
COPY . /criu
WORKDIR /criu
RUN contrib/apt-install maven "$CC" && contrib/dependencies/apt-packages.sh
RUN make mrproper && make -j $(nproc) CC="$CC"
ENTRYPOINT mvn -f test/javaTests/pom.xml test
ENTRYPOINT ["mvn", "-f", "test/javaTests/pom.xml", "test"]

View file

@ -1,5 +1,3 @@
COPY scripts/ci/apt-install /bin/apt-install
# Add the cross compiler sources
RUN apt-get clean -y && apt-get update -y && apt-get install -y --no-install-recommends gnupg2
@ -12,33 +10,6 @@ COPY scripts/ci/riscv64-cross/riscv64-sources.list /etc/apt/sources.list.d/
RUN dpkg --add-architecture ${DEBIAN_ARCH} && \
apt-get update -y
# Install required packages
RUN apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
git \
crossbuild-essential-${DEBIAN_ARCH} \
libc6-dev-${DEBIAN_ARCH}-cross \
libc6-${DEBIAN_ARCH}-cross \
libbz2-dev:${DEBIAN_ARCH} \
libexpat1-dev:${DEBIAN_ARCH} \
ncurses-dev:${DEBIAN_ARCH} \
libssl-dev:${DEBIAN_ARCH} \
protobuf-c-compiler \
protobuf-compiler \
python3-protobuf \
libnl-3-dev:${DEBIAN_ARCH} \
libprotobuf-dev:${DEBIAN_ARCH} \
libnet-dev:${DEBIAN_ARCH} \
libprotobuf-c-dev:${DEBIAN_ARCH} \
libcap-dev:${DEBIAN_ARCH} \
libaio-dev:${DEBIAN_ARCH} \
uuid-dev:${DEBIAN_ARCH} \
libnl-route-3-dev:${DEBIAN_ARCH} \
libnftables-dev:${DEBIAN_ARCH} \
libgnutls28-dev:${DEBIAN_ARCH} \
iproute2:${DEBIAN_ARCH}
ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
CROSS_ROOT=/usr/${CROSS_TRIPLET} \
AS=/usr/bin/${CROSS_TRIPLET}-as \
@ -55,4 +26,6 @@ ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
COPY . /criu
WORKDIR /criu
RUN make mrproper && date && make -j $(nproc) zdtm && date
RUN contrib/dependencies/apt-cross-packages.sh
RUN make mrproper && date && make -j $(nproc) zdtm && date

View file

@ -1,30 +1,7 @@
COPY scripts/ci/apt-install /bin/apt-install
# Add the cross compiler sources
RUN echo "deb http://deb.debian.org/debian/ stable main" >> /etc/apt/sources.list && \
dpkg --add-architecture ${DEBIAN_ARCH}
RUN apt-install \
crossbuild-essential-${DEBIAN_ARCH} \
libc6-dev-${DEBIAN_ARCH}-cross \
libc6-${DEBIAN_ARCH}-cross \
libbz2-dev:${DEBIAN_ARCH} \
libexpat1-dev:${DEBIAN_ARCH} \
ncurses-dev:${DEBIAN_ARCH} \
libssl-dev:${DEBIAN_ARCH} \
protobuf-c-compiler \
protobuf-compiler \
python3-protobuf \
libnl-3-dev:${DEBIAN_ARCH} \
libprotobuf-dev:${DEBIAN_ARCH} \
libnet-dev:${DEBIAN_ARCH} \
uuid-dev:${DEBIAN_ARCH} \
libprotobuf-c-dev:${DEBIAN_ARCH} \
libcap-dev:${DEBIAN_ARCH} \
libaio-dev:${DEBIAN_ARCH} \
libnl-route-3-dev:${DEBIAN_ARCH} \
libdrm-dev:${DEBIAN_ARCH}
ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
CROSS_ROOT=/usr/${CROSS_TRIPLET} \
AS=/usr/bin/${CROSS_TRIPLET}-as \
@ -41,6 +18,8 @@ ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
COPY . /criu
WORKDIR /criu
RUN contrib/dependencies/apt-cross-packages.sh
# amdgpu_plugin with armv7 is not supported
RUN make mrproper && date && \
make -j $(nproc) && \

View file

@ -1,40 +1,12 @@
ARG CC=gcc
COPY scripts/ci/apt-install /bin/apt-install
# On Ubuntu, kernel modules such as ip_tables and xt_mark may not be loaded by default
# We need to install kmod to enable iptables to load these modules for us.
RUN apt-install \
libnet-dev \
libnl-route-3-dev \
$CC \
bsdmainutils \
build-essential \
git-core \
iptables \
libaio-dev \
libbsd-dev \
libcap-dev \
libgnutls28-dev \
libgnutls30 \
libnftables-dev \
libnl-3-dev \
libprotobuf-c-dev \
libprotobuf-dev \
libselinux-dev \
iproute2 \
kmod \
pkg-config \
protobuf-c-compiler \
protobuf-compiler \
python3-minimal \
python3-protobuf \
uuid-dev \
python3-yaml
COPY . /criu
WORKDIR /criu
# On Ubuntu, kernel modules such as ip_tables and xt_mark may not be loaded by default
# We need to install kmod to enable iptables to load these modules for us.
RUN contrib/apt-install "$CC" && contrib/dependencies/apt-packages.sh
RUN git clean -dfx && date && \
# Check single object build
make -j $(nproc) CC="$CC" criu/parasite-syscall.o && \

View file

@ -1,29 +1,7 @@
COPY scripts/ci/apt-install /bin/apt-install
# Add the cross compiler sources
RUN echo "deb http://deb.debian.org/debian/ unstable main" >> /etc/apt/sources.list && \
dpkg --add-architecture ${DEBIAN_ARCH}
RUN apt-install \
crossbuild-essential-${DEBIAN_ARCH} \
libc6-dev-${DEBIAN_ARCH}-cross \
libc6-${DEBIAN_ARCH}-cross \
libbz2-dev:${DEBIAN_ARCH} \
libexpat1-dev:${DEBIAN_ARCH} \
ncurses-dev:${DEBIAN_ARCH} \
libssl-dev:${DEBIAN_ARCH} \
protobuf-c-compiler \
protobuf-compiler \
python3-protobuf \
libnl-3-dev:${DEBIAN_ARCH} \
libprotobuf-dev:${DEBIAN_ARCH} \
uuid-dev:${DEBIAN_ARCH} \
libnet-dev:${DEBIAN_ARCH} \
libprotobuf-c-dev:${DEBIAN_ARCH} \
libcap-dev:${DEBIAN_ARCH} \
libaio-dev:${DEBIAN_ARCH} \
libnl-route-3-dev:${DEBIAN_ARCH}
ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
CROSS_ROOT=/usr/${CROSS_TRIPLET} \
AS=/usr/bin/${CROSS_TRIPLET}-as \
@ -40,4 +18,6 @@ ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
COPY . /criu
WORKDIR /criu
RUN make mrproper && date && make -j $(nproc) zdtm && date
RUN contrib/dependencies/apt-cross-packages.sh
RUN make mrproper && date && make -j $(nproc) zdtm && date

View file

@ -1,5 +1,5 @@
FROM ubuntu:24.04
COPY scripts/ci/apt-install /bin/apt-install
COPY contrib/apt-install /bin/apt-install
RUN apt-install gcc-multilib

View file

@ -1,4 +1,4 @@
ARCHES := x86_64 fedora-asan fedora-rawhide armv7hf centos8
ARCHES := x86_64 fedora-asan fedora-rawhide armv7hf
STABLE_CROSS_ARCHES := armv7-stable-cross aarch64-stable-cross ppc64-stable-cross mips64el-stable-cross riscv64-stable-cross
UNSTABLE_CROSS_ARCHES := armv7-unstable-cross aarch64-unstable-cross ppc64-unstable-cross mips64el-unstable-cross
NON_CLANG := $(UNSTABLE_CROSS_ARCHES) $(STABLE_CROSS_ARCHES)