FROM svrnty/base-distro:flutter-sdk-linux-latest ARG FLUTTER_VERSION=3.38.9 LABEL org.opencontainers.image.title="flutter-sdk-linux" LABEL org.opencontainers.image.description="Flutter SDK for Linux desktop CI builds" LABEL org.opencontainers.image.version="${FLUTTER_VERSION}" USER 0 # Download Flutter SDK and strip unnecessary files RUN curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \ -o /tmp/flutter.tar.xz && \ tar xf /tmp/flutter.tar.xz -C /opt && \ rm /tmp/flutter.tar.xz && \ rm -rf /opt/flutter/dev \ /opt/flutter/examples \ /opt/flutter/bin/cache/artifacts/engine/android-* \ /opt/flutter/bin/cache/flutter_web_sdk RUN git config --global --add safe.directory /opt/flutter && \ cd /opt/flutter && git gc --prune=all # Fix ownership before switching to flutter user RUN chown -R 65532:65532 /opt/flutter USER 65532 # Configure Flutter for Linux desktop only RUN flutter config --enable-linux-desktop \ --no-enable-web \ --no-enable-android \ --no-enable-ios \ --no-enable-macos-desktop \ --no-enable-windows-desktop # Precache only Linux artifacts RUN flutter precache --linux \ --no-web \ --no-android \ --no-ios \ --no-macos \ --no-windows \ --no-fuchsia \ --no-universal RUN flutter doctor -v WORKDIR /app