Files
pipelines/app/docker/Dockerfile
T
alan 8138cdc3d9 Linux desktop: optimized release build, installer, Linux gaps
Build: split Dart debug info out of libapp.so (13.96 -> 11.27 MB, symbols
kept in the cache) and fix icon tree shaking, which Flutter 3.44's Linux
CMake backend silently disables by quoting the define; the build image
patches its SDK copy (MaterialIcons 1.6 MB -> 25 KB). Impeller cannot be
enabled in a Linux release build and was slower in a profile-build bench.

Install: `./install --linux --install` installs the bundle into
<prefix>/lib/app-linux with com.pipelines.app.desktop (the GTK/Wayland
app id), its icon and a ~/.local/bin/pipelines-app link, through
scripts/install-linux-app.sh.

Linux gaps: notifications through the freedesktop daemon; HTML artifacts
explain the missing web view instead of throwing; no Share for files;
a GTK clipboard reader for pasting files and screenshots (Ctrl+V and
Omarchy's Super+V); GTK header bar only on GNOME; window icon.

Bench: native fixture frame log, wheel/mark steps and
tool/perf/linux_desktop_bench.py (private Xvfb); results in
app/notes/linux-desktop-optimized.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:54:18 +00:00

63 lines
3.3 KiB
Docker

# Flutter build images for the Pipelines app. `web` builds the web client the
# installer serves; `android` adds a JDK and the Android SDK for the optional
# APK. The Flutter version is the app's own pin (app/.flutter-version).
#
# Built and run by scripts/app_build.py; the container runs as the invoking
# user, so the SDK and cache directories are world-writable.
FROM debian:bookworm-slim AS web
ARG FLUTTER_VERSION
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl git unzip xz-utils zip \
&& rm -rf /var/lib/apt/lists/*
RUN test -n "$FLUTTER_VERSION" \
&& git clone --depth 1 --branch "$FLUTTER_VERSION" https://github.com/flutter/flutter.git /opt/flutter \
&& git config --system --add safe.directory '*'
ENV PATH=/opt/flutter/bin:$PATH \
HOME=/home/builder \
PUB_CACHE=/home/builder/.pub-cache \
FLUTTER_SUPPRESS_ANALYTICS=true
RUN mkdir -p /home/builder/.pub-cache \
&& flutter --disable-analytics && flutter config --no-cli-animations \
&& flutter precache --web --no-android --no-ios --no-linux --no-macos --no-windows --no-fuchsia \
&& chmod -R a+rwX /opt/flutter /home/builder
COPY --chmod=0755 build.sh /usr/local/bin/pipelines-app-build
WORKDIR /tmp
FROM web AS linux
# Flutter's CMake backend passes `-dTreeShakeIcons="true"` with the quotes
# kept (no shell parses them), so `flutter build linux` never tree-shakes the
# icon fonts and ships the full 1.6 MB MaterialIcons font. Pass the plain value
# in this image's copy; the grep fails the build if the line ever changes.
RUN apt-get update \
&& apt-get install -y --no-install-recommends clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev liblzma-dev \
&& rm -rf /var/lib/apt/lists/* \
&& flutter precache --linux \
&& backend=/opt/flutter/packages/flutter_tools/bin/tool_backend.dart \
&& grep -q "'-dTreeShakeIcons=\"\$treeShakeIcons\"'," "$backend" \
&& sed -i "s/'-dTreeShakeIcons=\"\$treeShakeIcons\"',/'-dTreeShakeIcons=\$treeShakeIcons',/" "$backend" \
&& grep -q "'-dTreeShakeIcons=\$treeShakeIcons'," "$backend" \
&& chmod -R a+rwX /opt/flutter /home/builder
FROM web AS android
ARG ANDROID_CMDLINE_TOOLS=13114758
RUN apt-get update \
&& apt-get install -y --no-install-recommends openjdk-17-jdk-headless \
&& rm -rf /var/lib/apt/lists/*
# The container user has no passwd entry, so Java's user.home would be "?";
# point it, and Android's key store folder, at the mounted signing key.
ENV ANDROID_HOME=/opt/android-sdk \
ANDROID_SDK_ROOT=/opt/android-sdk \
ANDROID_USER_HOME=/home/builder/.android \
JAVA_TOOL_OPTIONS=-Duser.home=/home/builder \
GRADLE_USER_HOME=/home/builder/.gradle
ENV PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
RUN mkdir -p $ANDROID_HOME/cmdline-tools /home/builder/.gradle /home/builder/.android \
&& curl -fsSL -o /tmp/tools.zip "https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS}_latest.zip" \
&& unzip -q /tmp/tools.zip -d /tmp/tools && mv /tmp/tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest \
&& rm -rf /tmp/tools /tmp/tools.zip \
&& yes | sdkmanager --licenses >/dev/null \
&& sdkmanager "platform-tools" >/dev/null \
&& flutter config --android-sdk $ANDROID_HOME \
&& flutter precache --android \
&& chmod -R a+rwX /opt/android-sdk /opt/flutter /home/builder