flutterdockercircleci

How to update Docker image in CircleCI to match latest Flutter version?


We recently updated our Flutter version to 3.27.1 in our project. Since then, our CircleCI pipeline has been failing, likely because the Docker image we're currently using does not have the updated Flutter SDK.

Right now, our Dockerfile looks like this:

# Use the python image
FROM python:3.9.7-slim-bullseye

# Install required packages
RUN apt update && apt install -y \
    # For cloning Flutter SDK
    git \
    # Flutter SDK internally use curl to download Dart SDK
    curl \
    # Flutter SDK internally use unzip to install Dart SDK
    unzip \
    # For Flutter coverage generation
    lcov \
    && apt clean \
    && rm -rf /var/lib/apt/lists/*

# Install Flutter
ENV FLUTTER_VERSION=3.19.6
ENV FLUTTER_HOME=/usr/local/flutter
ENV PATH "$PATH:$FLUTTER_HOME/bin"
RUN \
    git clone --depth 1 --branch ${FLUTTER_VERSION} https://github.com/flutter/flutter.git ${FLUTTER_HOME} && \
    flutter doctor

Now that our CI runs Flutter tests and builds, we need an updated image.

  1. Is it enough to update FLUTTER_VERSION number in here ?
  2. Should we switch to a new Docker image that includes Flutter 3.27.1?
  3. If so, what is the recommended image to use in CircleCI?
  4. Or should we install Flutter manually inside a custom image?

Any guidance or examples would be appreciated.


Solution

  • After some investigation, we found that ENV FLUTTER_VERSION=3.27.1 is sufficient to support the CircleCI environment for building the Flutter app, and there's no need to change the image for now.