| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 | #================# BUILDER#================FROM archlinux/archlinux:base-devel as builder# Upgrade the systemRUN pacman -Syyu --noconfirm# Set up makepkg user and workdirARG user=makepkgRUN pacman -S --needed --noconfirm sudoRUN useradd --system --create-home $user && \    echo "$user ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoersENV PATH="/home/$user/.pub-cache/bin:/home/$user/flutter/bin:/home/$user/flutter/bin/cache/dart-sdk/bin:${PATH}"USER $userWORKDIR /home/$user# Install yayRUN sudo pacman -S --needed --noconfirm curl tarRUN curl -sSfL \    --output yay.tar.gz \    https://github.com/Jguer/yay/releases/download/v12.0.2/yay_12.0.2_x86_64.tar.gz && \  tar -xf yay.tar.gz && \  sudo mv yay_12.0.2_x86_64/yay /bin && \  rm -rf yay_12.0.2_x86_64 && \  yay --version# Install RustRUN yay -S --noconfirm curl base-devel openssl clang cmake ninja pkg-config xdg-user-dirsRUN xdg-user-dirs-updateRUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -yRUN source ~/.cargo/env && \    rustup toolchain install stable && \    rustup default stable# Install FlutterRUN sudo pacman -S --noconfirm git tar gtk3RUN curl -sSfL \      --output flutter.tar.xz \      https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.7.5-stable.tar.xz && \    tar -xf flutter.tar.xz && \    rm flutter.tar.xzRUN flutter config --enable-linux-desktopRUN flutter doctorRUN dart pub global activate protoc_plugin# Intall build dependencies for AppFlowyRUN sudo pacman -S --noconfirm git libkeybinder3 sqliteRUN source ~/.cargo/env && cargo install --force cargo-make duckscript_cli# Build AppFlowyCOPY . /appflowyRUN sudo chown -R $user: /appflowyWORKDIR /appflowyRUN cd frontend && \    source ~/.cargo/env && \    cargo make appflowy-flutter-deps-tools && \    cargo make -p production-linux-x86_64 appflowy-linux#================# APP#================FROM archlinux/archlinux# Upgrade the systemRUN pacman -Syyu --noconfirm# Install runtime dependenciesRUN pacman -S --noconfirm xdg-user-dirs gtk3 libkeybinder3 && \    pacman -Scc --noconfirm# Set up appflowy userARG user=appflowyARG uid=1000ARG gid=1000RUN groupadd --gid $gid $userRUN useradd --create-home --uid $uid --gid $gid $userUSER $user# Set up the AppFlowy appWORKDIR /home/$userCOPY --from=builder /appflowy/frontend/appflowy_flutter/build/linux/x64/release/bundle .RUN xdg-user-dirs-update && \    test -e ./AppFlowy && \    file ./AppFlowyCMD ["./AppFlowy"]
 |