dobu/deps/compositor-sandbox/Containerfile
2025-03-15 10:26:07 -04:00

48 lines
1.6 KiB
Docker

ARG WL_MITM_COMMIT=d133a2faa1732f8e3573fa81ef628fcc70a778f9
ARG XWAYLAND_SATELLITE_COMMIT=10cb041a80bb815cc1789cfa305923f1f9e3713d
FROM docker.io/archlinux:base-devel-20250302.0.316047 AS builder-rust
RUN pacman-key --init && pacman -Sy --noconfirm archlinux-keyring
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm git rustup xorg-xwayland wayland libdrm pixman mesa \
libxcb libxkbcommon-x11 xcb-util-cursor clang \
&& rustup default nightly \
&& rustup update
ARG WL_MITM_COMMIT
RUN mkdir /build && cd /build \
&& git clone https://gitea.angry.im/PeterCxy/wl-mitm \
&& cd wl-mitm \
&& git checkout $WL_MITM_COMMIT
RUN cd /build/wl-mitm && ./generate.sh && cargo build --release
ARG XWAYLAND_SATELLITE_COMMIT
RUN cd /build \
&& git clone https://github.com/Supreeeme/xwayland-satellite \
&& cd xwayland-satellite \
&& git checkout $XWAYLAND_SATELLITE_COMMIT
RUN cd /build/xwayland-satellite && cargo build --release
# Build from ../base-archlinux
FROM dobu/deps-base-archlinux:latest
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm xorg-xwayland pixman libnotify libxcb libxkbcommon-x11 xcb-util-cursor
COPY --from=builder-rust /build/wl-mitm/target/release/wl-mitm /usr/bin/
COPY --from=builder-rust /build/wl-mitm/contrib/notify-libnotify.sh /usr/bin/
COPY --from=builder-rust /build/xwayland-satellite/target/release/xwayland-satellite /usr/bin/
COPY ./entrypoint.sh /
USER user
# These paths MUST be bind-mounted from host
VOLUME /xdg_runtime
VOLUME /tmp/.X11-unix
VOLUME /tmp/wl-mitm-config.toml
ENTRYPOINT [ "/entrypoint.sh" ]