joystream-node-armv7.Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. FROM rust:1.52.1-buster AS rust
  2. RUN rustup self update
  3. RUN rustup install nightly-2021-02-20 --force
  4. RUN rustup default nightly-2021-02-20
  5. RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-02-20
  6. RUN rustup component add --toolchain nightly-2021-02-20 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-02-20
  16. RUN apt-get install -y libprotobuf-dev protobuf-compiler
  17. RUN BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
  18. cargo test --release --all && \
  19. cargo build --target armv7-unknown-linux-gnueabihf --release
  20. FROM ubuntu:21.04
  21. LABEL description="Joystream node"
  22. WORKDIR /joystream
  23. COPY --from=builder /joystream/target/armv7-unknown-linux-gnueabihf/release/joystream-node /joystream/node
  24. COPY --from=builder /joystream/target/armv7-unknown-linux-gnueabihf/release/wbuild/joystream-node-runtime/joystream_node_runtime.compact.wasm /joystream/runtime.compact.wasm
  25. COPY --from=builder /joystream/target/armv7-unknown-linux-gnueabihf/release/chain-spec-builder /joystream/chain-spec-builder
  26. # confirm it works
  27. RUN /joystream/node --version
  28. # https://manpages.debian.org/stretch/coreutils/b2sum.1.en.html
  29. # RUN apt-get install coreutils
  30. # print the blake2 256 hash of the wasm blob
  31. RUN b2sum -l 256 /joystream/runtime.compact.wasm
  32. # print the blake2 512 hash of the wasm blob
  33. RUN b2sum -l 512 /joystream/runtime.compact.wasm
  34. EXPOSE 30333 9933 9944
  35. # Use these volumes to persits chain state and keystore, eg.:
  36. # --base-path /data
  37. # optionally separate keystore (otherwise it will be stored in the base path)
  38. # --keystore-path /keystore
  39. # if base-path isn't specified, chain state is stored inside container in ~/.local/share/joystream-node/
  40. # which is not ideal
  41. VOLUME ["/data", "/keystore"]
  42. ENTRYPOINT ["/joystream/node"]