joystream-node.Dockerfile 1.8 KB

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