fix: remove too complex rootless logic

This commit is contained in:
ange 2024-11-14 18:42:58 +08:00
parent c792f5c039
commit c5ceb5d186
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -1,11 +1,12 @@
FROM docker.io/debian:12-slim as build
ENV DEBIAN_FRONTEND=noninteractive
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 tar -C /opt/ -xJf /flutter.tar.xz
RUN sdkmanager \
"build-tools;35.0.0" \
"cmdline-tools;9.0" \
@ -13,7 +14,8 @@ RUN sdkmanager \
"platforms;android-35"
FROM docker.io/debian:12-slim
RUN useradd -m app
ENV DEBIAN_FRONTEND=noninteractive
RUN touch /.dockerenv
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
@ -21,8 +23,7 @@ RUN apt-get update \
openjdk-17-jdk-headless \
unzip \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build --chown=app:app /opt/ /opt/
USER app
COPY --from=build --chown=0:0 /opt/ /opt/
ENV PATH="/opt/flutter/bin:$PATH"
RUN flutter config --android-sdk /opt/android-sdk/ \
&& yes | flutter doctor --android-licenses > /dev/null