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
FROM rust:bookworm
FROM voidlinux/voidlinux
RUN apt update && \
apt-get -y install clang && \
apt-get -y install libclang-dev && \
apt-get install -y sudo && \
apt-get install -y libgtk-4-dev && \
apt-get install -y libadwaita-1-0 && \
apt-get install -y meson && \
apt-get install -y ninja-build && \
apt-get install -y git && \
apt-get install -y valac && \
apt-get install -y gettext
RUN xbps-install -Syu xbps
RUN xbps-install -Syu && \
xbps-install -y base-devel && \
xbps-install -y clang && \
xbps-install -y pkg-config && \
xbps-install -y gtk4-devel && \
xbps-install -y libadwaita-devel && \
xbps-install -y rust && \
xbps-install -y cargo && \
xbps-install -y git
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN useradd -ms /bin/bash -G sudo lemoa
USER lemoa
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
WORKDIR /root
RUN git clone https://github.com/lemmy-gtk/lemoa
RUN cd lemoa && \
cargo build --release
#COPY --chown=lemoa:lemoa . /home/lemoa/lemoa
#RUN rustup component add rustfmt

View File

@ -38,16 +38,13 @@ Clone the repository and run
cargo run
```
# Build inside Docker
Be sure you to replace `$PATH_TO_REPO` with the path to this cloned repo on your filesystem.
# Building with Docker
```
sudo docker build --no-cache . -t lemoa:latest
sudo docker run -v $PATH_TO_REPO:/home/lemoa/lemoa_volume -it lemoa:latest bash
cd lemoa_volume/
cargo build
CONTAINER_ID=$(sudo docker create --name lemoa -t lemoa:latest)
sudo docker cp $(CONTAINER_ID):/root/lemoa/target/release/lemoa .
```
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
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.