gmeligio/flutter-android

Sponsored OSS

By gmeligio

Updated 5 days ago

Docker images for Flutter Continuous Integration (CI)

Image
Languages & frameworks
Developer tools
6

10K+

gmeligio/flutter-android repository overview

openssf scorecard Ask DeepWiki channel flutter-android version flutter-android pulls flutter-web version flutter-web pulls

Flutter Docker Image

Docker images for Flutter Continuous Integration (CI). The source is available on GitHub.

The images includes the minimum tools to run Flutter and build apps. The versions of the tools installed are based on the official Flutter repository. The final goal is that Flutter doesn't need to download anything like tools or SDKs when running the container.

Contents

Features

  • Analytics disabled by default, opt-in if ENABLE_ANALYTICS environment variable is passed when running the container.
  • Rootless user flutter:flutter, with permissions to run on GitHub workflows and GitLab CI.
  • Minimal images with predownloaded SDKs and tools ready to run flutter commands without further downloads:
    • flutter-android for the Android platform.
    • flutter-web for the Web platform.

Main tools in flutter-android:

  • Flutter SDK: 3.44.6
  • Java (OpenJDK): 17
  • Android SDK Platform: 36
  • Android NDK: 28.2.13676358
  • Gradle: 9.1.0
  • Fastlane: 2.237.0

Main tools in flutter-web:

  • Flutter SDK: 3.44.6
  • Web engine: precached (no runtime download)

Running Containers

On the terminal:

# From GitHub Container Registry
docker run --rm -it ghcr.io/gmeligio/flutter-android:3.44.6 bash

On a workflow in GitHub Actions:

jobs:
  build:
    runs-on: ubuntu-22.04
    container:
      image: ghcr.io/gmeligio/flutter-android:3.44.6
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Build
        run: flutter build apk

On a .gitlab-ci.yml in GitLab CI:

build:
  image: ghcr.io/gmeligio/flutter-android:3.44.6
  script:
    - flutter build apk

For Flutter web apps, use the flutter-web image:

jobs:
  build:
    runs-on: ubuntu-22.04
    container:
      image: ghcr.io/gmeligio/flutter-web:3.44.6
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Build
        run: flutter build web

These images run on GitHub Actions, GitLab CI, Gitea, and Forgejo. Ready-to-use workflows for each backend are in examples/ — the Gitea and Forgejo ones show how to make Node.js available for actions/checkout (act-based runners do not inject it the way GitHub does).

Tags

Every new tag on the flutter stable channel gets built. The tag is composed of the Flutter version used to build the image:

  • Docker image: gmeligio/flutter-android:3.44.6
  • Flutter version: 3.44.6

Building Locally

The android.Dockerfile expects a few arguments:

  • flutter_version <string>: The version of Flutter to use when building. Example: 3.44.6
  • android_build_tools_version <string>: The version of the Android SDK Build Tools to install. Example: 36.0.0
  • android_platform_versions <list>: The versions of the Android SDK Platforms to install, separated by spaces. Example: 36
# Android
docker build --target android --build-arg flutter_version=3.44.6 --build-arg fastlane_version=2.237.0 --build-arg android_build_tools_version=36.0.0 --build-arg android_platform_versions="36" -t android-test .

Roadmap

  • Minimal image with predownloaded SDKs and tools ready to run flutter commands for the platforms:
    • iOS
    • Linux
    • Windows
  • Android features:
    • Android emulator

FAQ

Why the images are not published in the AWS ECR Public registry?

The storage of the images starts to cost after 50 GB and increases with every pushed image because the AWS Free Tier covers up to 50 GB of total storage for free in ECR Public.

Why there is no dynamic tag like latest?

There is no latest Docker tag on purpose. You need to specify the version of the image you want to use. The reason for that is that latest can cause unexpected behavior when rerunning a past CI job that was expected to use the old build of the latest tag. There are multiple articles explaining more about this reasoning like What's Wrong With The Docker :latest Tag? and The misunderstood Docker tag: latest.

Contributing

See Contributing.

License

Flutter is licensed under BSD 3-Clause "New" or "Revised" license.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

The sources for producing gmeligio/flutter-android Docker images are licensed under MIT License.

Tag summary

Content type

Image

Digest

sha256:90ada9a59

Size

2.8 GB

Last updated

5 days ago

docker pull gmeligio/flutter-android:3.44.6

This week's pulls

Pulls:

1,039

Last week