joystream-node.Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. FROM rust:1.52.1-buster AS rust
  2. RUN rustup self update
  3. RUN rustup install nightly-2021-03-24 --force
  4. RUN rustup default nightly-2021-03-24
  5. RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-03-24
  6. RUN rustup component add --toolchain nightly-2021-03-24 clippy
  7. RUN apt-get update && \
  8. apt-get install -y curl git gcc xz-utils sudo pkg-config unzip clang llvm libc6-dev
  9. FROM rust AS builder
  10. LABEL description="Compiles all workspace artifacts"
  11. WORKDIR /joystream
  12. COPY . /joystream
  13. # Build all cargo crates
  14. # Ensure our tests and linter pass before actual build
  15. ENV WASM_BUILD_TOOLCHAIN=nightly-2021-03-24
  16. RUN BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
  17. cargo test --release --all && \
  18. cargo build --release
  19. FROM ubuntu:21.04
  20. LABEL description="Joystream node"
  21. WORKDIR /joystream
  22. COPY --from=builder /joystream/target/release/joystream-node /joystream/node
  23. COPY --from=builder /joystream/target/release/wbuild/joystream-node-runtime/joystream_node_runtime.compact.wasm /joystream/runtime.compact.wasm
  24. COPY --from=builder /joystream/target/release/chain-spec-builder /joystream/chain-spec-builder
  25. # confirm it works
  26. RUN /joystream/node --version
  27. # https://manpages.debian.org/stretch/coreutils/b2sum.1.en.html
  28. # RUN apt-get install coreutils
  29. # print the blake2 256 hash of the wasm blob
  30. RUN b2sum -l 256 /joystream/runtime.compact.wasm
  31. # print the blake2 512 hash of the wasm blob
  32. RUN b2sum -l 512 /joystream/runtime.compact.wasm
  33. EXPOSE 30333 9933 9944
  34. # Use these volumes to persits chain state and keystore, eg.:
  35. # --base-path /data
  36. # optionally separate keystore (otherwise it will be stored in the base path)
  37. # --keystore-path /keystore
  38. # if base-path isn't specified, chain state is stored inside container in ~/.local/share/joystream-node/
  39. # which is not ideal
  40. VOLUME ["/data", "/keystore"]
  41. ENTRYPOINT ["/joystream/node"]