Skip to content

Commit b63d061

Browse files
castrojoCopilot
andcommitted
feat(flatpak): add rancher-desktop
Package Rancher Desktop v1.22.0 as a Flatpak using the pre-built Linux zip from GitHub releases. Electron app extracted and wrapped with --no-sandbox for Flatpak sandbox compatibility. Permissions modeled on Podman Desktop (Flathub), since both apps manage containers and VMs: - --filesystem=home (config/state in non-XDG paths, no upstream fix) - --filesystem=host-os:ro (detect host CLI tools: docker, kubectl, etc.) - --filesystem=xdg-run/podman:create, containers:create, /run/docker.sock - --device=all (KVM required for Lima VM backend on Linux) - --talk-name=org.freedesktop.Flatpak (spawn host processes) x86_64 only — upstream ships no arm64 Linux build. x-skip-launch-check: true — Electron GUI exits 1 without display. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: Claude Sonnet 4.6 via GitHub Copilot
1 parent 39fa8e3 commit b63d061

File tree

4 files changed

+158
-0
lines changed

4 files changed

+158
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Rancher Desktop — Gotchas
2+
3+
## x-skip-launch-check: true
4+
Rancher Desktop is an Electron GUI app. In the headless gnome-49 CI container it exits 1
5+
("Missing X server or $DISPLAY" / Wayland not available). `x-skip-launch-check: true` is set
6+
in `manifest.yaml` so the e2e-install job skips the launch check and exits 0 after verifying
7+
the Flatpak installs correctly.
8+
9+
## x86_64 only
10+
Upstream ships a single Linux zip (`rancher-desktop-linux-v1.22.0.zip`) for x86_64 only.
11+
No arm64 Linux build is provided. `x-arches: [x86_64]` is set accordingly.
12+
13+
## --no-sandbox wrapper required
14+
The Electron SUID chrome-sandbox is incompatible with the Flatpak sandbox (cannot set uid 0
15+
inside the sandbox). A wrapper script at `/app/bin/rancher-desktop` passes `--no-sandbox`
16+
to the Electron binary. Flatpak provides its own sandboxing layer.
17+
18+
## --device=all (KVM for Lima VMs)
19+
Rancher Desktop uses Lima as the VM backend on Linux for container runtime isolation.
20+
Lima requires access to `/dev/kvm`. `--device=all` is the standard Flatpak permission for
21+
KVM access. See Podman Desktop for the same pattern.
22+
23+
## --filesystem=home
24+
Rancher Desktop writes config, state, and container data to non-XDG locations under `$HOME`
25+
(`~/.config/rancher-desktop`, `~/.local/share/rancher-desktop`, etc.) with no upstream option
26+
to relocate to XDG paths. `--filesystem=home` is required; tightening will break the app.
27+
28+
## --filesystem=host-os:ro
29+
Required to detect and invoke host-installed tools (docker CLI, nerdctl, kubectl, helm, etc.)
30+
from the host PATH. Modeled directly on the Podman Desktop Flathub manifest.
31+
32+
## finish-args-home-filesystem-access lint exception
33+
`flatpak-builder-lint` flags `--filesystem=home` as a lint warning/error. It is intentional
34+
here; the exception is declared in `exceptions.json`.
35+
36+
## Zip layout (v1.22.0)
37+
The GitHub release zip extracts as a flat directory:
38+
- `rancher-desktop` — main Electron binary (199 MB)
39+
- `resources/resources/icons/logo-square-512.png` — 512×512 app icon
40+
- `resources/resources/linux/rancher-desktop.desktop` — desktop entry
41+
- `resources/app.asar`, `resources/app.asar.unpacked/` — app bundle
42+
- Various Electron/Chromium shared libraries at root
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"io.rancherdesktop.RancherDesktop": [
3+
"appid-filename-mismatch",
4+
"appstream-no-flathub-manifest-key",
5+
"metainfo-missing-screenshots",
6+
"finish-args-home-filesystem-access"
7+
]
8+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop-application">
3+
<id>io.rancherdesktop.RancherDesktop</id>
4+
<name>Rancher Desktop</name>
5+
<summary>Container management and Kubernetes on the desktop</summary>
6+
<description>
7+
<p>
8+
Rancher Desktop is an open-source application that provides all the essentials
9+
to work with containers and Kubernetes on the desktop. It runs a local
10+
Kubernetes cluster, manages container images, and lets you choose between
11+
containerd and dockerd as the container runtime — all from a single GUI.
12+
</p>
13+
<p>
14+
Key features include a built-in Kubernetes cluster (powered by k3s), container
15+
image management, support for port forwarding and volume mounts, and integration
16+
with common developer tools like kubectl, nerdctl, and helm.
17+
</p>
18+
</description>
19+
<url type="homepage">https://rancherdesktop.io/</url>
20+
<url type="bugtracker">https://github.com/rancher-sandbox/rancher-desktop/issues</url>
21+
<metadata_license>MIT</metadata_license>
22+
<project_license>Apache-2.0</project_license>
23+
<categories>
24+
<category>Development</category>
25+
<category>Utility</category>
26+
</categories>
27+
<releases>
28+
<release version="1.22.0" date="2026-01-19"/>
29+
<release version="1.21.0" date="2025-10-24"/>
30+
<release version="1.20.1" date="2025-10-01"/>
31+
</releases>
32+
<content_rating type="oars-1.1"/>
33+
</component>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
app-id: io.rancherdesktop.RancherDesktop
2+
runtime: org.gnome.Platform
3+
runtime-version: "49"
4+
sdk: org.gnome.Sdk
5+
default-branch: stable
6+
x-version: "1.22.0"
7+
# x-arches: upstream only ships x86_64 Linux zip; no arm64 available
8+
x-arches: [x86_64]
9+
x-skip-launch-check: true # Electron GUI — exits 1 without display in CI
10+
command: rancher-desktop
11+
finish-args:
12+
# Windowing (X11 only; Electron does not fully support Wayland yet)
13+
- --socket=x11
14+
- --share=ipc
15+
- --device=dri
16+
# Full home access: Rancher Desktop stores config, images, and state under ~/.config/rancher-desktop
17+
# and manages container data in non-XDG paths. No upstream support for tighter scoping.
18+
- --filesystem=home
19+
# Read-only host OS view: needed to detect and invoke host-installed tools
20+
# (docker CLI, nerdctl, kubectl, helm, etc.) on the host PATH.
21+
- --filesystem=host-os:ro
22+
# Podman and container runtime sockets
23+
- --filesystem=xdg-run/podman:create
24+
- --filesystem=xdg-run/containers:create
25+
- --filesystem=/run/docker.sock
26+
# Network required: downloads images, communicates with container daemons, Kubernetes API
27+
- --share=network
28+
# KVM access: Rancher Desktop uses Lima for VM-based container runtime on Linux
29+
- --device=all
30+
# D-Bus: notifications and system tray
31+
- --talk-name=org.freedesktop.Notifications
32+
- --talk-name=org.kde.StatusNotifierWatcher
33+
# Spawn host processes (e.g. open browser, invoke host CLI tools)
34+
- --talk-name=org.freedesktop.Flatpak
35+
# Force X11 session type (Electron environment variable)
36+
- --env=XDG_SESSION_TYPE=x11
37+
- --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons
38+
modules:
39+
- name: rancher-desktop
40+
buildsystem: simple
41+
build-commands:
42+
# Unzip the Electron app bundle (flat layout at zip root)
43+
- unzip -q rancher-desktop-linux-v1.22.0.zip -d /app/rancher-desktop
44+
45+
# Install 512x512 icon
46+
- install -Dm644
47+
/app/rancher-desktop/resources/resources/icons/logo-square-512.png
48+
/app/share/icons/hicolor/512x512/apps/io.rancherdesktop.RancherDesktop.png
49+
50+
# Install and fix desktop file
51+
- install -Dm644
52+
/app/rancher-desktop/resources/resources/linux/rancher-desktop.desktop
53+
/app/share/applications/io.rancherdesktop.RancherDesktop.desktop
54+
- sed -i 's|^Exec=.*|Exec=rancher-desktop %U|'
55+
/app/share/applications/io.rancherdesktop.RancherDesktop.desktop
56+
- sed -i 's|^Icon=.*|Icon=io.rancherdesktop.RancherDesktop|'
57+
/app/share/applications/io.rancherdesktop.RancherDesktop.desktop
58+
59+
# Install metainfo
60+
- install -Dm644 io.rancherdesktop.RancherDesktop.metainfo.xml
61+
/app/share/metainfo/io.rancherdesktop.RancherDesktop.metainfo.xml
62+
63+
# Wrapper script: Electron SUID sandbox is incompatible with Flatpak sandbox
64+
- install -d /app/bin
65+
- printf '#!/bin/sh\nexec /app/rancher-desktop/rancher-desktop --no-sandbox "$@"\n'
66+
> /app/bin/rancher-desktop
67+
- chmod 755 /app/bin/rancher-desktop
68+
sources:
69+
- type: file
70+
url: https://github.com/rancher-sandbox/rancher-desktop/releases/download/v1.22.0/rancher-desktop-linux-v1.22.0.zip
71+
sha256: 081bc82ac988b1467f6445dddb483395ca7b1aac2164594fd5f4e2cb7344ba6d
72+
dest-filename: rancher-desktop-linux-v1.22.0.zip
73+
74+
- type: file
75+
path: io.rancherdesktop.RancherDesktop.metainfo.xml

0 commit comments

Comments
 (0)