Dockerfile.almalinux 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Use: docker build . --pull --no-cache --shm-size=196m -t darkfi:almalinux -f ./contrib/docker/Dockerfile.almalinux --build-arg DONT_EXEC_TESTS=1
  2. # optionally with: --build-arg OS_VER=almalinux/8-minimal --build-arg RUST_VER=nightly
  3. ARG RUST_VER=nightly-2025-04-10 # stable nightly beta 1.72
  4. ARG OS_VER=almalinux/9-minimal # almalinux/8-minimal
  5. FROM ${OS_VER} as rust_builder
  6. ARG RUST_VER
  7. RUN microdnf -y install gcc gcc-c++ kernel-headers cmake jq wget \
  8. pkg-config clang clang-libs llvm-libs \
  9. openssl-devel findutils fontconfig-devel \
  10. lato-fonts alsa-lib-devel python3-devel \
  11. perl-FindBin perl-File-Compare perl-lib sqlite-devel \
  12. perl-interpreter
  13. RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain "${RUST_VER}"
  14. ENV PATH="/root/.cargo/bin:${PATH}"
  15. RUN rustup target add wasm32-unknown-unknown
  16. RUN cargo search whatever # creates .cargo cache
  17. # 2. stage
  18. FROM rust_builder as builder
  19. ARG DONT_EXEC_TESTS
  20. ARG RUST_VER
  21. WORKDIR /opt/darkfi
  22. COPY . /opt/darkfi
  23. RUN make clean
  24. RUN cargo update
  25. RUN rm -rf ./target/ zkas proof/*.bin
  26. RUN bash -c "if [ -z \"$DONT_EXEC_TESTS\" ]; then make -j test; fi"
  27. RUN bash -c 'make -j all'
  28. # 3. stage
  29. FROM ${OS_VER}
  30. RUN microdnf -y install openssl lato-fonts alsa-lib\
  31. && microdnf clean all \
  32. && rm -rf /var/cache/dnf
  33. WORKDIR /opt/darkfi
  34. COPY --from=builder /opt/darkfi/drk /opt/darkfi/darkfid \
  35. /opt/darkfi/darkirc /opt/darkfi/faucetd \
  36. /opt/darkfi/zkas /opt/darkfi/vanityaddr \
  37. /opt/darkfi/tau /opt/darkfi/taud ./