mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-07 22:04:03 -05:00
* Dockerfile.almalinux and fix builds, latest working b36861fa1d_2023-06-13 * Docker build can skip tests, add runtime deps * update Fedora and Almalinux dockerfiles, worked for 95d0f47_2023-08-11 with "--build-arg DONT_EXEC_TESTS=1 --build-arg RUST_VER=nightly" --------- Co-authored-by: parazyd <parazyd@dyne.org>
61 lines
1.5 KiB
Docker
61 lines
1.5 KiB
Docker
# Use: docker build . --pull --no-cache --shm-size=196m -t darkfi:alpine -f ./contrib/docker/Dockerfile.alpine --build-arg DONT_EXEC_TESTS=1
|
|
# optionally with: --build-arg ALPINE_VER=3.18 --build-arg RUST_VER=nightly
|
|
|
|
ARG RUST_VER=nightly-2023-06-21 # 1.72 nightly stable
|
|
ARG ALPINE_VER=3.18 # 3.17
|
|
|
|
FROM alpine:${ALPINE_VER} as rust_builder
|
|
|
|
ARG RUST_VER
|
|
ARG ALPINE_VER
|
|
|
|
RUN apk update
|
|
|
|
RUN apk add cmake jq wget clang curl gcc make llvm-dev \
|
|
openssl-dev expat-dev freetype-dev libudev-zero-dev \
|
|
libgudev-dev pkgconf clang-dev fontconfig-dev bash \
|
|
ttf-opensans musl-dev alsa-lib-dev python3-dev perl sqlite-dev
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain "${RUST_VER}" --default-host $(uname -m)-unknown-linux-musl
|
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
RUN rustup target add wasm32-unknown-unknown
|
|
|
|
RUN cargo search whatever # creates .cargo cache
|
|
|
|
# 2. stage
|
|
FROM rust_builder as builder
|
|
|
|
ARG DONT_EXEC_TESTS
|
|
ARG RUST_VER
|
|
|
|
WORKDIR /opt/darkfi
|
|
|
|
COPY . ./
|
|
|
|
ARG RUSTFLAGS="-C target-feature=-crt-static"
|
|
|
|
RUN cargo update
|
|
|
|
RUN make clean
|
|
|
|
RUN rm -rf ./target/ zkas proof/*.bin
|
|
|
|
RUN bash -c "if [ -z \"$DONT_EXEC_TESTS\" ]; then make -j test; fi"
|
|
|
|
RUN bash -c 'make -j all'
|
|
|
|
# 3. stage
|
|
FROM alpine:${ALPINE_VER}
|
|
|
|
RUN apk add --no-cache openssl ttf-opensans libgcc alsa-lib sqlite-libs
|
|
|
|
WORKDIR /opt/darkfi
|
|
|
|
|
|
COPY --from=builder /opt/darkfi/drk /opt/darkfi/darkfid \
|
|
/opt/darkfi/darkirc /opt/darkfi/faucetd \
|
|
/opt/darkfi/zkas /opt/darkfi/vanityaddr \
|
|
/opt/darkfi/tau /opt/darkfi/taud ./
|