Dockerfile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. FROM archlinux/archlinux:base-devel as builder
  2. RUN pacman -Syy
  3. RUN pacman -Syu --needed --noconfirm git xdg-user-dirs
  4. # makepkg user and workdir
  5. ARG user=makepkg
  6. ENV PATH="/home/$user/.pub-cache/bin:/home/$user/.local/flutter/bin:/home/$user/.local/flutter/bin/cache/dart-sdk/bin:${PATH}"
  7. RUN useradd --system --create-home $user \
  8. && echo "$user ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$user
  9. USER $user
  10. WORKDIR /home/$user
  11. # Install yay
  12. RUN git clone https://aur.archlinux.org/yay.git \
  13. && cd yay \
  14. && makepkg -sri --needed --noconfirm
  15. RUN yay -S --noconfirm curl base-devel sqlite openssl clang cmake ninja pkg-config gtk3 unzip
  16. RUN xdg-user-dirs-update
  17. RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
  18. RUN source $HOME/.cargo/env && rustup toolchain install stable && rustup default stable
  19. RUN git clone https://github.com/flutter/flutter.git $HOME/.local/flutter
  20. RUN flutter channel stable
  21. RUN flutter config --enable-linux-desktop
  22. RUN flutter doctor
  23. RUN dart pub global activate protoc_plugin
  24. RUN sudo pacman -Syu --needed --noconfirm git xdg-user-dirs libkeybinder3
  25. RUN git clone https://github.com/AppFlowy-IO/appflowy.git && \
  26. cd appflowy/frontend && \
  27. source $HOME/.cargo/env && \
  28. cargo install --force cargo-make && \
  29. cargo install --force duckscript_cli && \
  30. cargo make flowy_dev && \
  31. cargo make -p production-linux-x86_64 appflowy-linux
  32. CMD ["/home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/app_flowy"]
  33. #################
  34. FROM archlinux/archlinux
  35. RUN pacman -Syy && \
  36. pacman -Syu --needed --noconfirm xdg-user-dirs && \
  37. pacman -Scc --noconfirm
  38. RUN xdg-user-dirs-update
  39. COPY --from=builder /usr/sbin/yay /usr/sbin/yay
  40. RUN yay -S --noconfirm gtk3 libkeybinder3
  41. ARG user=appflowy
  42. ARG uid=1000
  43. ARG gid=1000
  44. RUN groupadd --gid $gid appflowy
  45. RUN useradd --create-home --uid $uid --gid $gid $user
  46. USER $user
  47. WORKDIR /home/$user
  48. COPY --from=builder /home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/ .
  49. CMD ["./app_flowy"]