The -dev tag was only used for pipeline testing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5.3 KiB
5.3 KiB
Flutter SDK Docker Images
Lightweight Flutter SDK images for CI/CD pipelines. Built on Wolfi, a security-focused Linux distribution designed for containers.
Images
| Variant | Use Case | Size | Arch |
|---|---|---|---|
| Web/WASM builds | |||
| Android APK/AAB builds | |||
| Linux desktop builds |
Why Wolfi?
Wolfi is a lightweight Linux distribution built specifically for containers. It provides:
- Minimal footprint - Only essential packages, nothing extra
- Daily security updates - Patches applied quickly
- Designed for containers - No legacy cruft from traditional distros
Features
- Lightweight - Optimized for fast CI/CD pulls
- Secure - Built on Wolfi with continuous vulnerability scanning
- Multi-arch - Supports both
linux/amd64andlinux/arm64 - Non-root - Runs as unprivileged user (UID 65532)
- Supply chain security - SBOM and SLSA provenance attestations included
Dockerfile Examples
Web App
FROM svrnty/flutter-sdk:web-latest AS build
COPY . /app
WORKDIR /app
RUN flutter pub get && flutter build web --release
FROM nginx:alpine
COPY --from=build /app/build/web /usr/share/nginx/html
EXPOSE 80
Android APK
FROM svrnty/flutter-sdk:android-latest AS build
COPY . /app
WORKDIR /app
RUN flutter pub get && flutter build apk --release
FROM scratch
COPY --from=build /app/build/app/outputs/flutter-apk/app-release.apk /
Linux Desktop
FROM svrnty/flutter-sdk:linux-latest AS build
COPY . /app
WORKDIR /app
RUN flutter pub get && flutter build linux --release
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y libgtk-3-0 && rm -rf /var/lib/apt/lists/*
COPY --from=build /app/build/linux/x64/release/bundle /app
ENTRYPOINT ["/app/my_app"]
CI/CD
# GitHub Actions / Gitea Actions
jobs:
build:
runs-on: ubuntu-latest
container:
image: svrnty/flutter-sdk:android-latest
steps:
- uses: actions/checkout@v4
- run: flutter pub get
- run: flutter build apk --release
# GitLab CI
build:
image: svrnty/flutter-sdk:android-latest
script:
- flutter pub get
- flutter build apk --release
Tags
<variant>-latest- Latest stable Flutter release<variant>-<version>- Specific Flutter version (e.g.,android-3.38.9)
Automatic Updates
Images are automatically rebuilt when:
- New Flutter stable versions are released
- Base image security updates are available
Every build is scanned and includes supply chain attestations (SBOM, SLSA provenance).
License
MIT