Dockerfile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 git clone https://github.com/AppFlowy-IO/appflowy.git && \
  25. cd appflowy/frontend && \
  26. source $HOME/.cargo/env && \
  27. cargo install --force cargo-make && \
  28. cargo install --force duckscript_cli && \
  29. cargo make flowy_dev && \
  30. cargo make -p production-linux-x86 appflowy-linux
  31. CMD ["/home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/app_flowy"]
  32. #################
  33. FROM archlinux/archlinux
  34. RUN pacman -Syy && \
  35. pacman -Syu --needed --noconfirm xdg-user-dirs && \
  36. pacman -Scc --noconfirm
  37. RUN xdg-user-dirs-update
  38. COPY --from=builder /usr/sbin/yay /usr/sbin/yay
  39. RUN yay -S --noconfirm gtk3
  40. ARG user=appflowy
  41. ARG uid=1000
  42. ARG gid=1000
  43. RUN groupadd --gid $gid appflowy
  44. RUN useradd --create-home --uid $uid --gid $gid $user
  45. USER $user
  46. WORKDIR /home/$user
  47. COPY --from=builder /home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/ .
  48. CMD ["./app_flowy"]