Add OCI image and container desktop launcher
CI / check (push) Successful in 8s
CI / native (push) Successful in 1m17s

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:
nandi committed 2026-11-22 20:56:43 -08:00
1 parent 1746884744
commit b1f0965e02
8 files changed
+416

No files matched your search

+43
View File
@@ -162,6 +162,48 @@ as its icon and the program name is `org.latha.moonmix`, which matches the
`.desktop` file so Wayland shells show it too. Run from a checkout, moonmix
also searches `./data/icons` and `$MOONMIX_ICON_DIR`.
### OCI container and desktop launcher (Wayland)
With **rootless Podman**, Python 3, a Wayland desktop and a running host
PipeWire session, no host MoonBit toolchain or audio/GTK development
packages are needed:
```sh
podman build --format=oci -t localhost/moonmix:latest .
python3 tools/install-container.py
~/.local/bin/moonmix-container
```
The multi-stage `Containerfile` builds a release executable, then installs
only runtime dependencies, icons and fonts in the final Ubuntu 26.04 LTS
image. Its GTK 4.22 avoids GTK 4.18's startup crash on compositors advertising
linux-dmabuf v6, including recent KDE Plasma. Set
`--build-arg MOONBIT_VERSION=<version>` to select a particular MoonBit
toolchain. The image stays local; it is not published to a registry.
The installer adds **moonmix** to the application menu, using an absolute
path to `~/.local/bin/moonmix-container`, and installs the app icons. It
replaces the per-user native `.desktop` entry, if present, but leaves the
native `~/.local/bin/moonmix` executable untouched. The installed runner
does not depend on this checkout. Rebuild the image after source changes;
set `MOONMIX_IMAGE` to run a different local tag.
The runner maps your user ID and mounts only the Wayland and PipeWire
sockets (including `PIPEWIRE_RUNTIME_DIR` / `PIPEWIRE_REMOTE` overrides),
plus `$XDG_RUNTIME_DIR/bus` when present for desktop appearance settings.
It has no network, GPU devices, home-directory mount or elevated privileges;
the root filesystem is read-only and temporary files disappear on exit.
Software rendering avoids depending on the host's GPU drivers. The image
sets `MOONMIX_ICON_THEME=Adwaita` so a host-only icon theme (such as Papirus)
does not cause missing icons; native runs keep the desktop's icon theme.
This is packaging, **not a sandbox for untrusted apps**: the sockets still
grant access to your audio session, display and, when mounted, session
D-Bus. X11 sessions are not supported by this runner.
The image also includes `moonmix-probe` for diagnostics; run it with
`podman exec <running-container> moonmix-probe` to inspect the host audio
graph without changing it.
### Icons
Everything else uses the desktop's icon theme (Adwaita, Breeze, Papirus...
@@ -209,6 +251,7 @@ $P meter <id> # peak over ~1.5 s; exit 6 if silent
```sh
moon test --target wasm-gc # pure model tests, no libraries needed
moon check --target native # type-check everything
python3 tools/test-container.py # runner/desktop tests, no image build needed
tools/smoke-test.sh /tmp/shot # needs pipewire, wireplumber, pw-cat, gtk4-broadwayd
# (+ python3-gi, dbus-daemon for the accent shots)
```