| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 | #================# BUILDER#================FROM archlinux/archlinux:base-devel as builderRUN chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo# 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 1.70 && \    rustup default 1.70# 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.10.1-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 20.0.1# Install build dependencies for AppFlowyRUN sudo pacman -S --noconfirm git libkeybinder3 sqlite clang rsyncRUN 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 flutter_clean && \    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"]
 |