dobu/deps/sommelier/Containerfile

40 lines
1.3 KiB
Docker

FROM docker.io/archlinux:base-devel-20240101.0.204074 AS builder
ARG SOMMELIER_COMMIT=371dd81388a946cd3cdae12288c05a6b3509fd7f
RUN pacman-key --init && pacman -Sy --noconfirm archlinux-keyring
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm git meson ninja python python-jinja \
xorg-xwayland wayland libdrm pixman mesa \
libxcb libxkbcommon-x11
RUN mkdir /build && cd /build \
&& git clone https://chromium.googlesource.com/chromiumos/platform2 \
&& cd platform2 \
&& git checkout $SOMMELIER_COMMIT
RUN cd /build/platform2/vm_tools/sommelier \
&& sed -i 's/args\[i++\] = "-rootless";/args[i++] = "-rootless"; args[i++] = "-extension"; args[i++] = "MIT-SHM";/' sommelier.cc \
&& sed -i 's/bool noop_driver = false;/bool noop_driver = true;/' sommelier.cc \
&& meson build -Dwith_tests=false && ninja -C build
# Build from ../base-archlinux
FROM dobu/deps-base-archlinux:latest
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm xorg-xwayland pixman
COPY --from=builder /build/platform2/vm_tools/sommelier/build/sommelier /usr/bin/
COPY ./entrypoint.sh /
USER user
ENV WM_RENDER_NODE=/dev/dri/renderD128
# These paths MUST be bind-mounted from host
VOLUME /xdg_runtime
VOLUME /tmp/.X11-unix
ENTRYPOINT [ "/entrypoint.sh" ]