mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: multiple improvements in docker image
* Reduce image size again, to 894MB * Adjust permissions and remove need to run xhost * Run appflowy as unprivileged user * Add README file for more information
This commit is contained in:
parent
b8a4897056
commit
0b2bb33b73
@ -6,7 +6,7 @@ RUN pacman -Syu --needed --noconfirm git xdg-user-dirs
|
||||
|
||||
# makepkg user and workdir
|
||||
ARG user=makepkg
|
||||
ENV PATH="/home/makepkg/.pub-cache/bin:/home/makepkg/.local/flutter/bin:/home/makepkg/.local/flutter/bin/cache/dart-sdk/bin:${PATH}"
|
||||
ENV PATH="/home/$user/.pub-cache/bin:/home/$user/.local/flutter/bin:/home/$user/.local/flutter/bin/cache/dart-sdk/bin:${PATH}"
|
||||
RUN useradd --system --create-home $user \
|
||||
&& echo "$user ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$user
|
||||
USER $user
|
||||
@ -15,9 +15,7 @@ WORKDIR /home/$user
|
||||
# Install yay
|
||||
RUN git clone https://aur.archlinux.org/yay.git \
|
||||
&& cd yay \
|
||||
&& makepkg -sri --needed --noconfirm \
|
||||
&& cd \
|
||||
&& rm -rf .cache yay
|
||||
&& makepkg -sri --needed --noconfirm
|
||||
|
||||
RUN yay -S --noconfirm curl base-devel sqlite openssl clang cmake ninja pkg-config gtk3 unzip
|
||||
RUN xdg-user-dirs-update
|
||||
@ -40,21 +38,25 @@ cargo make -p production-linux-x86 appflowy-linux
|
||||
CMD ["/home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/app_flowy"]
|
||||
|
||||
#################
|
||||
FROM archlinux/archlinux:base-devel
|
||||
FROM archlinux/archlinux
|
||||
|
||||
RUN pacman -Syy
|
||||
RUN pacman -Syu --needed --noconfirm xdg-user-dirs
|
||||
RUN pacman -Syy && \
|
||||
pacman -Syu --needed --noconfirm xdg-user-dirs && \
|
||||
pacman -Scc --noconfirm
|
||||
RUN xdg-user-dirs-update
|
||||
|
||||
ARG user=makepkg
|
||||
RUN useradd --system --create-home $user \
|
||||
&& echo "$user ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/$user
|
||||
USER $user
|
||||
WORKDIR /home/$user
|
||||
|
||||
COPY --from=builder /usr/sbin/yay /usr/sbin/yay
|
||||
RUN yay -S --noconfirm gtk3
|
||||
|
||||
COPY --from=builder /home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle ./AppFlowy
|
||||
ARG user=appflowy
|
||||
ARG uid=1000
|
||||
ARG gid=1000
|
||||
|
||||
CMD ["/home/makepkg/AppFlowy/app_flowy"]
|
||||
RUN groupadd --gid $gid appflowy
|
||||
RUN useradd --create-home --uid $uid --gid $gid $user
|
||||
USER $user
|
||||
WORKDIR /home/$user
|
||||
|
||||
COPY --from=builder /home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/ .
|
||||
|
||||
CMD ["./app_flowy"]
|
||||
|
11
frontend/scripts/docker-buildfiles/README.md
Normal file
11
frontend/scripts/docker-buildfiles/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Docker image
|
||||
|
||||
Build AppFlowy docker image using the following command:
|
||||
|
||||
```
|
||||
docker-compose build --build-arg uid=$(id -u) --build-arg gid=$(id -g)
|
||||
```
|
||||
|
||||
For more information, check out our documentation:
|
||||
|
||||
https://appflowy.gitbook.io/docs/essential-documentation/install-appflowy/installation-methods/installing-with-docker
|
Loading…
Reference in New Issue
Block a user