From f3bdc0413092430f7fd312457a8625ce5b51f887 Mon Sep 17 00:00:00 2001 From: R-Bharathraj Date: Mon, 28 Sep 2026 19:55:33 +0530 Subject: [PATCH] updated docker error --- Dockerfile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 321b445..eb50edb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,35 @@ # Flutter web build, served as static files by nginx. # # Dokploy builds this repo with its Dockerfile provider, so the image does the -# whole job: pull the Flutter SDK, compile the web bundle, hand the output to a -# web server. Nothing from the build stage survives into the final image but +# whole job: install the Flutter SDK, compile the web bundle, hand the output to +# a web server. Nothing from the build stage survives into the final image but # build/web. +# +# The SDK comes from the official archive at a pinned version rather than from a +# `flutter:stable` image: those images trail the real stable channel, and the +# one tagged stable ships a Dart older than the SDK floor in pubspec.yaml, so +# `pub get` refuses to resolve. Keep FLUTTER_VERSION in step with the toolchain +# the app is developed against. -FROM ghcr.io/cirruslabs/flutter:stable AS build +FROM debian:bookworm-slim AS build + +ARG FLUTTER_VERSION=3.44.9 + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates curl git unzip xz-utils \ + && rm -rf /var/lib/apt/lists/* + +RUN curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \ + | tar -xJ -C /opt + +ENV PATH="/opt/flutter/bin:${PATH}" + +# The SDK is a git checkout owned by a different user than the one building, so +# without this every flutter command dies on git's dubious-ownership check. +RUN git config --global --add safe.directory /opt/flutter \ + && flutter config --disable-analytics \ + && flutter precache --web WORKDIR /app