Switch Dockerfile to using void linux for better compile times

This commit is contained in:
Bnyro 2023-06-20 11:09:12 +02:00
parent ef0c99db0b
commit 6ef57d3c9f
2 changed files with 19 additions and 31 deletions

View File

@ -1,30 +1,21 @@
#bookworm refers to the debian version #bookworm refers to the debian version
FROM rust:bookworm FROM voidlinux/voidlinux
RUN apt update && \ RUN xbps-install -Syu xbps
apt-get -y install clang && \ RUN xbps-install -Syu && \
apt-get -y install libclang-dev && \ xbps-install -y base-devel && \
apt-get install -y sudo && \ xbps-install -y clang && \
apt-get install -y libgtk-4-dev && \ xbps-install -y pkg-config && \
apt-get install -y libadwaita-1-0 && \ xbps-install -y gtk4-devel && \
apt-get install -y meson && \ xbps-install -y libadwaita-devel && \
apt-get install -y ninja-build && \ xbps-install -y rust && \
apt-get install -y git && \ xbps-install -y cargo && \
apt-get install -y valac && \ xbps-install -y git
apt-get install -y gettext
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers WORKDIR /root
RUN git clone https://github.com/lemmy-gtk/lemoa
RUN useradd -ms /bin/bash -G sudo lemoa RUN cd lemoa && \
USER lemoa cargo build --release
WORKDIR /home/lemoa
RUN git clone --recursive https://gitlab.gnome.org/GNOME/libadwaita.git
RUN cd /home/lemoa/libadwaita && git checkout 1.2.0
RUN cd /home/lemoa/libadwaita && sudo meson . _build
RUN cd /home/lemoa/libadwaita && sudo ninja -C _build
RUN cd /home/lemoa/libadwaita && sudo ninja -C _build install
RUN mkdir lemoa_volume
#COPY --chown=lemoa:lemoa . /home/lemoa/lemoa #COPY --chown=lemoa:lemoa . /home/lemoa/lemoa
#RUN rustup component add rustfmt #RUN rustup component add rustfmt

View File

@ -38,16 +38,13 @@ Clone the repository and run
cargo run cargo run
``` ```
# Build inside Docker # Building with Docker
Be sure you to replace `$PATH_TO_REPO` with the path to this cloned repo on your filesystem.
``` ```
sudo docker build --no-cache . -t lemoa:latest sudo docker build --no-cache . -t lemoa:latest
sudo docker run -v $PATH_TO_REPO:/home/lemoa/lemoa_volume -it lemoa:latest bash CONTAINER_ID=$(sudo docker create --name lemoa -t lemoa:latest)
cd lemoa_volume/ sudo docker cp $(CONTAINER_ID):/root/lemoa/target/release/lemoa .
cargo build
``` ```
The binary will also be available on your host system since $PATH_TO_REPO is mounted as a shared volume between docker and host. Once the build is done, there will be an executable `lemoa` binary file in your current directory, executing it starts Lemoa :tada:.
# License # License
Lemoa is licensed under the [**GNU General Public License**](https://www.gnu.org/licenses/gpl.html): You can use, study and share it as you want. Lemoa is licensed under the [**GNU General Public License**](https://www.gnu.org/licenses/gpl.html): You can use, study and share it as you want.