feat: precache gradle
All checks were successful
/ build (push) Successful in 8m40s

This commit is contained in:
ange 2025-01-27 15:17:45 +00:00
parent 7cb18de6d7
commit fc9c206d38
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 16 additions and 2 deletions

View File

@ -28,10 +28,13 @@ RUN apt-get update \
openjdk-17-jdk-headless \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN curl -Lo /gradle.zip \
'https://services.gradle.org/distributions/gradle-8.12.1-bin.zip'
COPY --from=build /opt/ /opt/
ENV PATH="/opt/flutter/bin:$PATH"
RUN flutter config --android-sdk /opt/android-sdk/
RUN yes | flutter doctor --android-licenses
RUN flutter precache --android
RUN yes | flutter doctor --android-licenses
COPY entrypoint.sh /usr/local/bin/
WORKDIR /app/
ENTRYPOINT ["flutter", "--no-version-check"]
ENTRYPOINT ["entrypoint.sh"]

11
entrypoint.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash -e
cp -r . /app.tmp/
cd /app.tmp/
sed -i '/^distributionUrl/s =.\+ =file\\:///gradle.zip ' \
android/gradle/wrapper/gradle-wrapper.properties
flutter --no-version-check "$@"
cd -
cp -r /app.tmp/build/ .