flutter/Dockerfile
ange 8aef35c547
Some checks failed
/ build (push) Failing after 3s
feat: reduce cache to make image smaller
2024-11-09 13:10:47 +08:00

27 lines
825 B
Docker

FROM docker.io/debian:12-slim as build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
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/ -xJf /flutter.tar.xz
FROM docker.io/debian:12-slim
RUN useradd -m app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
git \
sdkmanager \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN sdkmanager \
"build-tools;35.0.0" \
"cmdline-tools;9.0" \
"platform-tools;35.0.2" \
"platforms;android-35"
COPY --from=build --chown=app:app --exclude=cache /opt/ /opt/
USER app
ENV PATH="/opt/flutter/bin:$PATH"
RUN flutter doctor