diff --git a/.gitignore b/.gitignore index 895d48a..f60605f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target +/build # RustRover .idea/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d6b299 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:24.04 AS build + +RUN apt-get update && apt-get -y upgrade +RUN apt-get -y install \ + gcc \ + curl \ + pkg-config \ + libssl-dev + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +COPY . /cln-backup + +WORKDIR /cln-backup +RUN cargo build --release + +FROM scratch AS binaries + +COPY --from=build /cln-backup/target/release/backup / diff --git a/Makefile b/Makefile index 7ae98ff..f146f35 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,7 @@ +docker-build: + docker buildx build . -o=build --target=binaries + clippy: cargo clippy --all-targets --all-features -- -D warnings + +.PHONY: docker-build clippy diff --git a/README.md b/README.md index 5450dbe..99077e8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Configuration is done through the `backup.toml` file in the lightning directory. Compiling the plugin requires Rust to be installed. +Alternatively, you can use `make docker-build` to build a release binary in a Docker container (output in `./build/` directory). + By default, the plugin is compiled with S3 and WebDAV support: ```bash