Dockerfile.alpine 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Use: docker build . --pull --network=host -t darkfi:alpine -f ./contrib/docker/Dockerfile.alpine
  2. # optionally with: --build-arg ALPINE_VER=3.17 --build-arg RUST_VER=nightly
  3. # The wallet test fail problem (see below) was the same for alpine 3.17 and rust nightly
  4. ARG RUST_VER=1.67
  5. ARG ALPINE_VER=3.17
  6. FROM alpine:${ALPINE_VER} as rust_builder
  7. ARG RUST_VER
  8. ARG ALPINE_VER
  9. RUN echo "=======================================================" \
  10. &&echo "===>>>>> The following error will occur during the test::" \
  11. && echo "test net::hosts::tests::test_filter_invalid ... ok" \
  12. && echo "test consensus::state::tests::calc_sigmas_test ... ok" \
  13. && echo "error: test failed, to rerun pass '-p darkfi --lib'" \
  14. && echo ".... process didn't exit successfully: /opt/darkfi/target/release/deps/darkfi-... (signal: 11, SIGSEGV: invalid memory reference)" \
  15. && echo "rust ${RUST_VER} / alpine ${ALPINE_VER}" \
  16. && cat /etc/os-release \
  17. && echo "====>>>>> wait 30 sec to continue; CTRL+C to break" \
  18. && sleep 30
  19. RUN apk update
  20. RUN apk add cmake jq wget clang curl gcc make llvm-dev \
  21. openssl-dev expat-dev freetype-dev libudev-zero-dev \
  22. libgudev-dev pkgconf clang-dev fontconfig-dev build-base bash
  23. # build-base ? musl-dev was enough, maybe libc-dev too
  24. RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain "${RUST_VER}"
  25. ENV PATH="/root/.cargo/bin:${PATH}"
  26. RUN rustup target add wasm32-unknown-unknown
  27. RUN cargo search whatever # creates .cargo cache
  28. # 2. stage
  29. FROM rust_builder as builder
  30. WORKDIR /opt/darkfi
  31. COPY . ./
  32. RUN make clean
  33. RUN rm -rf ./target/
  34. RUN bash -c 'make -j test && make -j'
  35. # 3. stage
  36. FROM alpine:${ALPINE_VER}
  37. RUN apk update && apk add openssl # ?? TODO lato-fonts
  38. WORKDIR /opt/darkfi
  39. COPY --from=builder /opt/darkfi/drk /opt/darkfi/darkfid /opt/darkfi/tau \
  40. /opt/darkfi/taud /opt/darkfi/ircd /opt/darkfi/dnetview /opt/darkfi/faucetd \
  41. /opt/darkfi/darkwikid /opt/darkfi/darkwiki /opt/darkfi/zkas /opt/darkfi/vanityaddr ./