diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..fa8be62bbd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.github +.gitignore + +Dockerfile +target diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..50f0f195a3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM rust:bookworm AS builder + +RUN apt-get update +RUN apt-get install -y build-essential libssl-dev pkg-config +RUN apt-get install -y protobuf-compiler libprotobuf-dev +RUN apt-get install -y clang-format clang-tidy \ + clang-tools clang clangd libc++-dev \ + libc++1 libc++abi-dev libc++abi1 \ + libclang-dev libclang1 liblldb-dev \ + libllvm-ocaml-dev libomp-dev libomp5 \ + lld lldb llvm-dev llvm-runtime \ + llvm python3-clang + +RUN cargo install wasm-pack +RUN rustup target add wasm32-unknown-unknown + +# TODO cache build dependencies +COPY . /rusty-kaspa +WORKDIR /rusty-kaspa +RUN cargo build --release + + +FROM debian:bookworm + +COPY --from=builder /rusty-kaspa/target/release/kaspad /usr/bin/ +COPY --from=builder /rusty-kaspa/target/release/kaspa-wallet /usr/bin/ + +CMD kaspad diff --git a/README.md b/README.md index be552c6780..a0daad6038 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,22 @@ The framework is compatible with all major desktop and mobile browsers. +
+Building on Docker + +You can also use Docker to build binaries. +``` +docker build -t kaspa-rusty . +``` + +Then you can run kaspad using. +``` +docker run --rm -it kaspa-rusty:latest +``` + +
+ + ## Running the node **Start a mainnet node**