summaryrefslogtreecommitdiff
path: root/Dockerfile.flutter-ci
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-18 18:59:14 +0300
committerPaul Buetow <paul@buetow.org>2026-05-18 18:59:14 +0300
commite89d039fa85cab00f34ee45e99b801f92c58ff3a (patch)
tree6dced1760a2c0e44db0392c399f7c32595f06ee1 /Dockerfile.flutter-ci
parent567cdef73eb4385d937ddd74a988e489890b3cc1 (diff)
Add Dockerfile.flutter-ci and update android.yml to use project image
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'Dockerfile.flutter-ci')
-rw-r--r--Dockerfile.flutter-ci45
1 files changed, 45 insertions, 0 deletions
diff --git a/Dockerfile.flutter-ci b/Dockerfile.flutter-ci
new file mode 100644
index 0000000..f768042
--- /dev/null
+++ b/Dockerfile.flutter-ci
@@ -0,0 +1,45 @@
+# Dockerfile.flutter-ci — Flutter SDK image for CI use.
+#
+# Built on top of the official Dart Docker image and installs a pinned Flutter
+# SDK release. Used by .woodpecker/android.yml to run `flutter analyze` and
+# `flutter test` without downloading the SDK on every CI run.
+#
+# To build and push (replace TAG with the Flutter SDK version, e.g. 3.32.0):
+#
+# docker build --build-arg FLUTTER_VERSION=3.32.0 \
+# -t codeberg.org/snonux/player/flutter-ci:3.32.0 \
+# -f Dockerfile.flutter-ci .
+# docker push codeberg.org/snonux/player/flutter-ci:3.32.0
+#
+# Update .woodpecker/android.yml to reference the new tag when upgrading.
+
+FROM dart:3.8-sdk AS flutter-ci
+
+ARG FLUTTER_VERSION=3.32.0
+
+# Install system packages needed by flutter, git, and the Dart toolchain.
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ bash \
+ curl \
+ git \
+ unzip \
+ xz-utils \
+ && rm -rf /var/lib/apt/lists/*
+
+# Download and install the Flutter SDK at the pinned version.
+RUN git clone --depth 1 --branch "${FLUTTER_VERSION}" \
+ https://github.com/flutter/flutter.git /opt/flutter
+
+ENV PATH="/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:${PATH}"
+ENV FLUTTER_ROOT=/opt/flutter
+
+# Pre-warm the Flutter tool cache: downloads the Dart SDK embedded in Flutter,
+# sets up the engine and tool, and configures the CLI for CI use.
+RUN flutter config --no-analytics \
+ && flutter precache --no-android --no-ios --no-linux --no-macos --no-web \
+ && flutter doctor --suppress-analytics
+
+# Pub cache lives here; mount as a Woodpecker named volume to persist across runs.
+ENV PUB_CACHE=/root/.pub-cache
+
+WORKDIR /workspace