Skip to content

Commit

Permalink
Replace Flutter archive download with git clone of Flutter repo
Browse files Browse the repository at this point in the history
Use a build matching the current architecture rather than downloading a prebuilt archive
  • Loading branch information
takenagain committed May 22, 2024
1 parent 2f258ca commit 6160a98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 10 additions & 10 deletions .docker/android-apk-build.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM --platform=linux/amd64 ubuntu:latest as build
FROM ubuntu:latest as build

ENV FLUTTER_HOME "/home/komodo/.flutter-sdk"

RUN apt update && \
apt upgrade -y && \
Expand All @@ -16,22 +18,20 @@ RUN curl -o assets/coins.json https://raw.githubusercontent.com/KomodoPlatform/c
mkdir -p android/app/src/main/cpp/libs/arm64-v8a && \
python3 -m venv .venv && \
.venv/bin/pip install -r .docker/requirements.txt && \
.venv/bin/python .docker/update_api.py --force
.venv/bin/python .docker/update_api.py --force && \
git clone https://github.com/flutter/flutter.git ${FLUTTER_HOME} && \
cd ${FLUTTER_HOME} && \
git fetch && \
git checkout tags/2.8.1

FROM --platform=linux/amd64 ghcr.io/cirruslabs/android-sdk:34 as final
FROM ghcr.io/cirruslabs/android-sdk:34 as final

ENV FLUTTER_VERSION="2.8.1"
ENV FLUTTER_HOME "/home/komodo/.flutter-sdk"
ENV USER="komodo"
ENV PATH $PATH:$FLUTTER_HOME/bin

# Download and extract Flutter SDK
RUN mkdir -p $FLUTTER_HOME \
&& git config --global --add safe.directory /home/komodo/.flutter-sdk \
&& cd $FLUTTER_HOME \
&& curl --fail --remote-time --silent --location -O https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz \
&& tar xf flutter_linux_${FLUTTER_VERSION}-stable.tar.xz --strip-components=1 \
&& rm flutter_linux_${FLUTTER_VERSION}-stable.tar.xz
COPY --from=build --chown=$USER:$USER ${FLUTTER_HOME} ${FLUTTER_HOME}

RUN flutter config --no-analytics \
&& flutter precache \
Expand Down
9 changes: 4 additions & 5 deletions .docker/android-dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ USER $USER
# Download and extract Flutter SDK
RUN mkdir -p /home/komodo/workspace \
&& chown -R $USER:$USER /home/komodo/workspace \
&& mkdir -p $FLUTTER_HOME \
&& cd $FLUTTER_HOME \
&& curl --fail --remote-time --silent --location -O https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz \
&& tar xf flutter_linux_${FLUTTER_VERSION}-stable.tar.xz --strip-components=1 \
&& rm flutter_linux_${FLUTTER_VERSION}-stable.tar.xz \
&& git clone https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
&& cd ${FLUTTER_HOME} \
&& git fetch \
&& git checkout tags/2.8.1 \
&& flutter config --no-analytics \
&& flutter precache \
&& yes "y" | flutter doctor --android-licenses \
Expand Down

0 comments on commit 6160a98

Please sign in to comment.