Sign inSign up

hamguy/flutter

By hamguy

•Updated over 3 years ago

flutter docker image with web-config enabled

Image
0

39

hamguy/flutter repository overview

This image specified the flutter version to 2.10.3 by default, you can change the version in 2 ways request:

  1. change the ARG value to the specified version
  2. run build command with --build-arg arg, e.g:

docker build --build-arg flutter_version=2.10.3 -t flutter:2.10.3 .

Here is the Dockerfile that will help you build your own image.


FROM nginx:latest

# flutter version
ARG flutter_version=2.10.3

USER root

# enviroment value
ENV PATH="/opt/flutter/bin:/opt/flutter/bin/cache/dart-sdk/bin:${PATH}" \
    PUB_HOSTED_URL=https://pub.flutter-io.cn \
    FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

# flutter sdk
RUN apt-get update \
    && apt-get install -y git \
    && apt-get install --assume-yes --fix-missing apt-utils \
    && apt-get install -y unzip \
    && git clone --branch $flutter_version --depth 1 https://github.com/flutter/flutter.git /opt/flutter \
    && /opt/flutter/bin/flutter config --no-analytics \
    && /opt/flutter/bin/flutter precache \
    && chown -R root:root /opt/flutter \
    && flutter doctor \
    && flutter config --enable-web \
    && rm -rf /var/lib/apt/lists/*

Tag summary

Content type

Image

Digest

sha256:d76d6f482…

Size

745.7 MB

Last updated

over 3 years ago

docker pull hamguy/flutter:2.10.3