Add OCI image and container desktop launcher
Build a release OCI image with runtime dependencies and a rootless Podman launcher for Wayland and PipeWire. Install the runner, app-menu entry, and icons per user without replacing the native executable. Use Ubuntu 26.04 and GTK 4.22 for linux-dmabuf v6 compatibility. Allow an explicit icon-theme override so the container uses its bundled Adwaita assets. Document installation and add runner/desktop regression tests.
This commit is contained in:
1 parent
1746884744
commit
b1f0965e02
8 files changed
+416
No files matched your search
@@ -0,0 +1,51 @@
|
||||
# GTK >= 4.20 avoids linux-dmabuf v6 startup crashes on modern compositors.
|
||||
ARG BASE_IMAGE=docker.io/library/ubuntu:26.04
|
||||
FROM ${BASE_IMAGE} AS build
|
||||
|
||||
ARG MOONBIT_VERSION=latest
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl build-essential pkg-config \
|
||||
libpipewire-0.3-dev libwireplumber-0.5-dev libgtk-4-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN curl -fsSL --retry 5 https://cli.moonbitlang.com/install/unix.sh -o /tmp/moonbit-install.sh \
|
||||
&& bash /tmp/moonbit-install.sh "$MOONBIT_VERSION" \
|
||||
&& rm /tmp/moonbit-install.sh
|
||||
ENV PATH="/root/.moon/bin:${PATH}"
|
||||
|
||||
WORKDIR /src
|
||||
COPY moon.mod ./
|
||||
COPY cmd/ cmd/
|
||||
COPY model/ model/
|
||||
COPY wp/ wp/
|
||||
COPY gtk/ gtk/
|
||||
COPY tools/pkg-cc tools/pkg-ar tools/
|
||||
RUN moon build --target native --release \
|
||||
&& install -Dm755 _build/native/release/build/cmd/moonmix/moonmix.exe /out/usr/local/bin/moonmix \
|
||||
&& install -Dm755 _build/native/release/build/cmd/moonmix-probe/moonmix-probe.exe /out/usr/local/bin/moonmix-probe
|
||||
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
LABEL org.opencontainers.image.title="moonmix" \
|
||||
org.opencontainers.image.description="GTK4 volume control for the host PipeWire session" \
|
||||
org.opencontainers.image.source="https://git.site.latha.org/geordi/moonmix"
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
libgtk-4-1 libwireplumber-0.5-0 pipewire-bin \
|
||||
libpipewire-0.3-modules libspa-0.2-modules \
|
||||
librsvg2-common adwaita-icon-theme fonts-dejavu-core \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& test -r /usr/share/pipewire/client.conf
|
||||
COPY --from=build /out/ /
|
||||
COPY data/org.latha.moonmix.desktop /usr/share/applications/org.latha.moonmix.desktop
|
||||
COPY data/icons/ /usr/share/icons/
|
||||
COPY --chmod=755 tools/container-entrypoint /usr/local/bin/moonmix-entrypoint
|
||||
RUN gtk-update-icon-cache -f -t /usr/share/icons/hicolor
|
||||
|
||||
# Software rendering needs neither host GPU devices nor matching GPU drivers.
|
||||
ENV GDK_BACKEND=wayland GSK_RENDERER=cairo HOME=/tmp XDG_RUNTIME_DIR=/tmp/moonmix-runtime
|
||||
# Do not select an icon theme advertised by the host but absent from the image.
|
||||
ENV MOONMIX_ICON_THEME=Adwaita
|
||||
USER 65532:65532
|
||||
ENTRYPOINT ["/usr/local/bin/moonmix-entrypoint"]
|
||||
CMD ["/usr/local/bin/moonmix"]
|
||||
Reference in new issue
Block a user