flutter/Dockerfile
ange 0afd524627
All checks were successful
/ build (push) Successful in 4m13s
fix: android licenses for real this time
2024-11-14 17:40:16 +08:00

30 lines
975 B
Docker

FROM docker.io/debian:12-slim as build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
sdkmanager \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
ADD https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.24.4-stable.tar.xz /flutter.tar.xz
RUN tar -C /opt/ --exclude=cache -xJf /flutter.tar.xz
RUN sdkmanager \
"build-tools;35.0.0" \
"cmdline-tools;9.0" \
"platform-tools;35.0.2" \
"platforms;android-35"
FROM docker.io/debian:12-slim
RUN useradd -m app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
git \
openjdk-17-jdk-headless \
unzip \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build --chown=app:app /opt/ /opt/
USER app
ENV PATH="/opt/flutter/bin:$PATH"
RUN flutter config --android-sdk /opt/android-sdk/ \
&& yes | flutter doctor --android-licenses > /dev/null
ENTRYPOINT ["flutter"]