joystream-node.Dockerfile 1.8 KB

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