From a05277740a0648265ec5bcfcce685e0552443f54 Mon Sep 17 00:00:00 2001 From: Aleksandr Mezin Date: Sun, 29 Dec 2024 01:36:16 +0200 Subject: [PATCH] Add Alpine Linux --- .github/workflows/common.yml | 12 ++++++++++++ alpine.dockerfile | 27 +++++++++++++++++++++++++++ test/test-wayland.sh | 3 ++- test/test-x11.sh | 4 ++-- 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 alpine.dockerfile diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 3644dec..1c3d74a 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -24,6 +24,18 @@ jobs: fail-fast: false matrix: include: + - image: alpine-3.18 + dockerfile: alpine.dockerfile + + - image: alpine-3.19 + dockerfile: alpine.dockerfile + + - image: alpine-3.20 + dockerfile: alpine.dockerfile + + - image: alpine-3.21 + dockerfile: alpine.dockerfile + - image: centos-stream9 dockerfile: fedora.dockerfile diff --git a/alpine.dockerfile b/alpine.dockerfile new file mode 100644 index 0000000..b99087d --- /dev/null +++ b/alpine.dockerfile @@ -0,0 +1,27 @@ +ARG base_image=alpine-3.21 + +FROM docker.io/library/alpine:3.21@sha256:21dc6063fd678b478f57c0e13f47560d0ea4eeba26dfc947b2a4f81f686b9f45 AS alpine-3.21 +FROM docker.io/library/alpine:3.20@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a AS alpine-3.20 +FROM docker.io/library/alpine:3.19@sha256:7a85bf5dc56c949be827f84f9185161265c58f589bb8b2a6b6bb6d3076c1be21 AS alpine-3.19 +FROM docker.io/library/alpine:3.18@sha256:2995c82e8e723d9a5c8585cb8e901d1c50e3c2759031027d3bff577449435157 AS alpine-3.18 + +RUN apk add \ + xvfb \ + xinit \ + elogind \ + polkit-elogind \ + mesa \ + mesa-dri-gallium \ + gnome-shell \ + gdm \ + vte3 \ + vte3-gtk4 \ + libhandy1 \ + wl-clipboard \ + && rm -rf /var/cache/apk/* + +RUN sed -i '/getty/d' /etc/inittab && \ + rc-update add elogind && \ + rc-update add polkit + +CMD [ "/sbin/init" ] diff --git a/test/test-wayland.sh b/test/test-wayland.sh index 4bc809f..bdf2e0d 100755 --- a/test/test-wayland.sh +++ b/test/test-wayland.sh @@ -8,7 +8,7 @@ fi SCRIPT_DIR=$(CDPATH="" cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) function shutdown { - podman exec "$CID" systemctl list-units --failed || true + podman exec "$CID" sh -c 'if command -v systemctl; then systemctl list-units --failed; else rc-status; fi' || true podman rm -f "$CID" } @@ -44,6 +44,7 @@ podman exec "$CID" gdbus wait --system --timeout=60 org.freedesktop.login1 podman exec "--user=$UID" "${ENV_VARS[@]/#/--env=}" "$CID" dbus-daemon --session --nopidfile --syslog --fork "--address=unix:path=${SHARED_DIR}/runtime/bus" env "${ENV_VARS[@]}" dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer.Ping +podman exec "$CID" mkdir -m 01777 /tmp/.X11-unix podman exec "--user=$UID" "${ENV_VARS[@]/#/--env=}" "$CID" gnome-shell --wayland --headless --sm-disable --unsafe-mode --virtual-monitor 1600x960 & env "${ENV_VARS[@]}" gdbus wait --session --timeout=60 org.gnome.Shell.Screenshot diff --git a/test/test-x11.sh b/test/test-x11.sh index 9d8156c..8d361b6 100755 --- a/test/test-x11.sh +++ b/test/test-x11.sh @@ -8,7 +8,7 @@ fi SCRIPT_DIR=$(CDPATH="" cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) function shutdown { - podman exec "$CID" systemctl list-units --failed || true + podman exec "$CID" sh -c 'if command -v systemctl; then systemctl list-units --failed; else rc-status; fi' || true podman rm -f "$CID" } @@ -45,7 +45,7 @@ podman exec "--user=$UID" "${ENV_VARS[@]/#/--env=}" "$CID" dbus-daemon --session env "${ENV_VARS[@]}" dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Peer.Ping mkfifo "${SHARED_DIR}/display_pipe" -podman exec "--user=$UID" "${ENV_VARS[@]/#/--env=}" "$CID" bash -c "Xvfb -screen 0 1600x960x24 -nolisten tcp -displayfd 3 3>'${SHARED_DIR}/display_pipe'" & +podman exec "--user=$UID" "${ENV_VARS[@]/#/--env=}" "$CID" sh -c "Xvfb -screen 0 1600x960x24 -nolisten tcp -displayfd 3 3>'${SHARED_DIR}/display_pipe'" & read -r DISPLAY_NUMBER <"${SHARED_DIR}/display_pipe"