diff --git a/Dockerfile b/Dockerfile index 395a49e..720a21d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index 5ffe95c..811b8a9 100644 --- a/README.md +++ b/README.md @@ -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.