Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: improve maintenance of test containers #2423

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 0 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
- { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' }
- { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo:latest' }
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
Expand Down
23 changes: 11 additions & 12 deletions test/container/Dockerfile-Arch
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ FROM docker.io/archlinux

MAINTAINER https://github.com/dracutdevs/dracut

# Install needed packages for the dracut CI container
RUN pacman --noconfirm -Syu \
linux dash strace dhclient asciidoc cpio pigz squashfs-tools \
qemu btrfs-progs mdadm dmraid nfs-utils nfsidmap lvm2 nbd \
dhcp networkmanager multipath-tools vi tcpdump open-iscsi connman \
git shfmt shellcheck astyle which base-devel glibc parted ntfs-3g && yes | pacman -Scc
# install aur helper to allow easy install of aur packages
RUN pacman --noconfirm -Syu base-devel git
RUN useradd -m build && echo "build ALL=(ALL) NOPASSWD: /usr/bin/pacman" > "/etc/sudoers.d/allow_pacman"
RUN su build -c 'cd && git clone https://aur.archlinux.org/paru-bin.git && cd paru-bin && makepkg -s --noconfirm' && pacman -U --noconfirm ~build/paru-bin/*.pkg.tar.*

COPY tools/* /tmp/
WORKDIR /tmp

RUN useradd -m build
RUN su build -c 'cd && git clone https://aur.archlinux.org/perl-config-general.git && cd perl-config-general && makepkg -s --noconfirm'
RUN pacman -U --noconfirm ~build/perl-config-general/*.pkg.tar.*
RUN su build -c 'cd && git clone https://aur.archlinux.org/tgt.git && cd tgt && makepkg -s --noconfirm'
RUN pacman -U --noconfirm ~build/tgt/*.pkg.tar.*
RUN rm -fr ~build
# Install needed packages for the dracut CI container
# Assume that initramfs virtual package is installed so that the default mkinitcpio package does not get installed
RUN su build -c 'paru --needed --noconfirm -Syu --assume-installed initramfs `/tmp/test-packages.sh` ' \
&& yes | paru -Sccd
62 changes: 4 additions & 58 deletions test/container/Dockerfile-Debian
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,12 @@ FROM docker.io/debian:latest

MAINTAINER https://github.com/dracutdevs/dracut

COPY tools/* /tmp/
WORKDIR /tmp

# Install needed packages for the dracut CI container
# Install dracut as a linux-initramfs-tool provider so that the default initramfs-tool package does not get installed
# Uninstall initramfs-tools-core as a workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994492
RUN apt-get update -y -qq && apt-get upgrade -y -qq && apt-get install -y -qq --no-install-recommends dracut && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \
asciidoc \
astyle \
btrfs-progs \
busybox-static \
bzip2 \
ca-certificates \
console-setup \
cpio \
cryptsetup \
curl \
dash \
debhelper \
debhelper-compat \
dmraid \
docbook \
docbook-xml \
docbook-xsl \
fdisk \
g++ \
gawk \
git \
iputils-arping \
iputils-ping \
isc-dhcp-client \
isc-dhcp-server \
kmod \
less \
libdmraid-dev \
libkmod-dev \
linux-image-generic \
lvm2 \
make \
mdadm \
multipath-tools \
nbd-client \
nbd-server \
network-manager \
nfs-kernel-server \
ntfs-3g \
open-iscsi \
ovmf \
parted \
pigz \
pkg-config \
procps \
qemu-system-x86 \
quilt \
shellcheck \
squashfs-tools \
strace \
sudo \
systemd-boot-efi \
tcpdump \
tgt \
thin-provisioning-tools \
vim \
wget \
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 $(/tmp/test-packages.sh) \
&& apt-get clean && dpkg -P --force-depends dracut dracut-core initramfs-tools-core
69 changes: 4 additions & 65 deletions test/container/Dockerfile-Fedora-latest
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,9 @@ FROM registry.fedoraproject.org/fedora:latest

MAINTAINER https://github.com/dracutdevs/dracut

COPY tools/* /tmp/
WORKDIR /tmp

# Install needed packages for the dracut CI container
RUN dnf -y install --setopt=install_weak_deps=False \
asciidoc \
bash-completion \
biosdevname \
bluez \
btrfs-progs \
busybox \
bzip2 \
cifs-utils \
cryptsetup \
dash \
dbus-daemon \
device-mapper-multipath \
dhcp-client \
dhcp-server \
dmraid \
e2fsprogs \
f2fs-tools \
fcoe-utils \
fuse3 \
gcc \
git \
iproute \
iputils \
iscsi-initiator-utils \
kbd \
kernel \
kmod-devel \
libkcapi-hmaccalc \
libselinux-utils \
lvm2 \
lzop \
make \
mdadm \
memstrack \
mksh \
nbd \
ndctl \
NetworkManager \
nfs-utils \
ntfs-3g \
ntfsprogs \
nvme-cli \
parted \
pcsc-lite \
pigz \
qemu-system-x86-core \
rng-tools \
rpm-build \
sbsigntools \
scsi-target-utils \
ShellCheck \
shfmt \
squashfs-tools \
strace \
sudo \
systemd-boot-unsigned \
systemd-networkd \
systemd-resolved \
tar \
tcpdump \
tpm2-tools \
wget \
which \
xz \
RUN dnf -y install --setopt=install_weak_deps=False $(/tmp/test-packages.sh) \
&& dnf -y remove dracut --noautoremove && dnf -y update && dnf clean all
11 changes: 4 additions & 7 deletions test/container/Dockerfile-OpenSuse-latest
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ FROM registry.opensuse.org/opensuse/tumbleweed-dnf:latest

MAINTAINER https://github.com/dracutdevs/dracut

COPY tools/* /tmp/
WORKDIR /tmp

# Install needed packages for the dracut CI container
RUN dnf -y install --setopt=install_weak_deps=False \
dash asciidoc mdadm lvm2 dmraid cryptsetup nfs-utils nbd dhcp-server \
strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \
sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \
tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \
iscsiuio open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \
multipath-tools util-linux-systemd systemd-boot \
RUN dnf -y install --setopt=install_weak_deps=False $(/tmp/test-packages.sh) \
&& dnf -y remove dracut && dnf -y update && dnf clean all
174 changes: 174 additions & 0 deletions tools/test-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#!/bin/sh

if [ -f /etc/os-release ]; then
# shellcheck disable=SC1091
. /etc/os-release
fi

# common packages
cat << EOF
asciidoc
astyle
bash-completion
bluez
busybox
bzip2
cifs-utils
cryptsetup
dash
dmraid
f2fs-tools
fuse3
gawk
gcc
git
jq
kbd
lvm2
lzop
make
mdadm
ndctl
ntfs-3g
nvme-cli
parted
pigz
rng-tools
shfmt
strace
sudo
tar
tcpdump
vim
wget
which
EOF

# common packages (but not openSUSE)
if [ -x /usr/bin/yum ] || [ -x /usr/bin/dpkg ] || [ -x /usr/bin/pacman ]; then
cat << EOF
btrfs-progs
squashfs-tools
tpm2-tools
EOF
fi

# packages for rpm based distros
if [ -x /usr/bin/rpm ]; then
cat << EOF
dhcp-client
dhcp-server
e2fsprogs
iproute
iputils
kernel
nbd
NetworkManager
nfs-utils
ntfsprogs
rpm-build
ShellCheck
xz
EOF
fi

if [ -x /usr/bin/yum ] || [ -x /usr/bin/pacman ]; then
cat << EOF
biosdevname
memstrack
nfs-utils
sbsigntools
EOF
fi

if [ -x /usr/bin/yum ]; then
cat << EOF
dbus-daemon
device-mapper-multipath
fcoe-utils
iscsi-initiator-utils
kmod-devel
libkcapi-hmaccalc
libselinux-utils
mksh
pcsc-lite
qemu-system-x86-core
scsi-target-utils
systemd-boot-unsigned
systemd-networkd
systemd-resolved
EOF
fi

if [ "$ID" = "opensuse-tumbleweed" ]; then
cat << EOF
btrfsprogs
dbus-broker
iscsiuio
libkmod-devel
multipath-tools
open-iscsi
procps
qemu-kvm
squashfs
systemd-boot
tgt
/usr/bin/qemu-system-$(uname -m)
util-linux-systemd
EOF
fi

if [ -x /usr/bin/pacman ]; then
cat << EOF
connman
cpio
dhclient
dhcp
linux
multipath-tools
networkmanager
open-iscsi
pcsclite
qemu
shellcheck
tgt
EOF
fi

# packages for deb based distro's
if [ -x /usr/bin/dpkg ]; then
cat << EOF
ca-certificates
console-setup
cpio
curl
debhelper
debhelper-compat
docbook
docbook-xml
docbook-xsl
fdisk
iputils-arping
iputils-ping
isc-dhcp-client
isc-dhcp-server
iscsiuio
libdmraid-dev
libkmod-dev
linux-image-generic
multipath-tools
nbd-client
nbd-server
network-manager
nfs-kernel-server
open-iscsi
ovmf
pkg-config
procps
qemu-system-x86
shellcheck
systemd-boot-efi
tgt
thin-provisioning-tools
EOF
fi
Loading