mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 14:48:08 -05:00
Dockerfile.almalinux and fix builds, latest working b36861fa1d_2023-06-13 (#183)
* 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>
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
# Use: docker build . --network=host --pull -t darkfi:ubuntu -f ./contrib/docker/Dockerfile.ubuntu
|
||||
# optionally with: --build-arg BUILD_OS_VER=20.04 --build-arg RUST_VER=1.70
|
||||
# Use: docker build . --pull --no-cache --shm-size=196m -t darkfi:ubuntu -f ./contrib/docker/Dockerfile.ubuntu --build-arg DONT_EXEC_TESTS=1
|
||||
# optionally with: --build-arg OS_VER=20.04 --build-arg RUST_VER=nightly
|
||||
|
||||
ARG RUST_VER=1.70 # stable nightly beta 1.67
|
||||
ARG BUILD_OS_VER=22.04 # 20.04
|
||||
ARG RUN_OS_VER=${BUILD_OS_VER}
|
||||
ARG REPOSITORY=ubuntu
|
||||
ARG RUST_VER=nightly-2023-06-21 # stable nightly beta 1.72
|
||||
ARG OS_VER=22.04 # 20.04
|
||||
|
||||
FROM ${REPOSITORY}:${BUILD_OS_VER} as rust_builder
|
||||
FROM ubuntu:${OS_VER} as rust_builder
|
||||
|
||||
ARG RUST_VER
|
||||
|
||||
@@ -14,7 +12,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install
|
||||
build-essential cmake jq wget curl \
|
||||
pkg-config clang libclang-dev llvm-dev libudev-dev libfreetype6-dev \
|
||||
libexpat1-dev curl gcc make libssl-dev fonts-lato libfontconfig-dev \
|
||||
libasound2-dev
|
||||
libasound2-dev python3-dev libsqlite3-dev
|
||||
|
||||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain "${RUST_VER}"
|
||||
|
||||
@@ -27,24 +25,32 @@ 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 . /opt/darkfi
|
||||
|
||||
RUN cargo update
|
||||
|
||||
RUN make clean
|
||||
|
||||
RUN rm -rf ./target/*
|
||||
RUN rm -rf ./target/ zkas proof/*.bin
|
||||
|
||||
RUN bash -c 'make -j test && make -j all'
|
||||
RUN bash -c "if [ -z \"$DONT_EXEC_TESTS\" ]; then make -j test; fi"
|
||||
|
||||
RUN bash -c 'make -j all'
|
||||
|
||||
# 3. stage
|
||||
FROM ${REPOSITORY}:${RUN_OS_VER}
|
||||
FROM ubuntu:${OS_VER}
|
||||
|
||||
RUN apt-get -y update && apt-get install -y openssl fonts-lato \
|
||||
RUN apt-get -y update && apt-get install -y openssl fonts-lato libout123-0 libmpg123-0 libasound2 libsqlite3-0 \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt/darkfi
|
||||
|
||||
COPY --from=builder /opt/darkfi/drk /opt/darkfi/darkfid \
|
||||
/opt/darkfi/ircd /opt/darkfi/dnetview /opt/darkfi/faucetd \
|
||||
/opt/darkfi/zkas /opt/darkfi/vanityaddr ./
|
||||
/opt/darkfi/darkirc /opt/darkfi/faucetd \
|
||||
/opt/darkfi/zkas /opt/darkfi/vanityaddr \
|
||||
/opt/darkfi/tau /opt/darkfi/taud ./
|
||||
|
||||
Reference in New Issue
Block a user