flutter image with web feature installed
357
As a DevOps specialist I hate flutter web! But I hate wasting time more than I hate flutter. I tried all available images for building flutter web applications and only liked cirruslabs/flutter, they provide better and most stable version of flutter images compare to others and I only had a tiny problem with it:
Installation of web feature for flutter takes too long for an automation process !
So in CodingCogs We decided to make a pre built Flutter web Docker image. This Image!
In order to use this Image do as you do in your normal flutter web development and write your docker file like this:
# to build with canvaskit renderer
FROM codingcogs/flutter-web:latest as builder
WORKDIR /app
COPY . .
RUN flutter build web --web-renderer canvaskit --release
# Adding a file to nginx web server
FROM nginx:1.25.1-alpine as runner
COPY --from=builder /app/build/web /usr/share/nginx/html
or
# to build with html renderer
FROM codingcogs/flutter-web:latest as builder
WORKDIR /app
COPY . .
RUN flutter build web --web-renderer html --release
# Adding a file to nginx web server
FROM nginx:1.25.1-alpine as runner
COPY --from=builder /app/build/web /usr/share/nginx/html
With this Dockerfile your app would be available at port 80 of the container
Content type
Image
Digest
sha256:3735b412d…
Size
1005.4 MB
Last updated
almost 3 years ago
docker pull codingcogs/flutter-web