Dockerfile_experimental 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # syntax=docker/dockerfile:experimental
  2. # must enable experimental features in docker daemon and set DOCKER_BUILDKIT=1 env variable
  3. # https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md
  4. FROM joystream/rust-builder AS builder
  5. LABEL description="compiles and caches dependencies, artifacts and node"
  6. WORKDIR /joystream
  7. COPY . /joystream
  8. RUN mkdir /build-output
  9. RUN --mount=type=cache,target=/joystream/target \
  10. --mount=type=cache,target=/root/.cargo/git \
  11. --mount=type=cache,target=/root/.cargo/registry \
  12. cargo build --release \
  13. && cp ./target/release/joystream-node /build-output/joystream-node
  14. # copy in last part could be done with nightly option --out-dir
  15. FROM debian:stretch
  16. LABEL description="Joystream node"
  17. WORKDIR /joystream
  18. COPY --from=builder /build-output/joystream-node /joystream/node
  19. # Use these volumes to persits chain state and keystore, eg.:
  20. # --base-path /data
  21. # optionally separate keystore (otherwise it will be stored in the base path)
  22. # --keystore-path /keystore
  23. # if base-path isn't specified, chain state is stored inside container in ~/.local/share/joystream-node/
  24. # which is not ideal
  25. VOLUME ["/data", "/keystore"]
  26. ENTRYPOINT ["/joystream/node"]