Files
darkfi/contrib/docker/Dockerfile.fedora
parazyd 88865e2663 drk: Replace "play" with "rodio".
Fun police go away.

This removes the deps on pkgconfig and libmpg123, and should ease the
build process for non GNU/Linux operating systems.
2023-06-06 14:06:36 +02:00

50 lines
1.1 KiB
Docker

# Use: docker build . --pull --network=host -t darkfi:fedora -f ./contrib/docker/Dockerfile.fedora
# optionally with: --build-arg OS_VER=fedora:36 --build-arg RUST_VER=nightly
ARG RUST_VER=1.67 # stable nightly beta 1.65
ARG OS_VER=fedora:37 # fedora:36
FROM ${OS_VER} as rust_builder
ARG RUST_VER
RUN dnf -y install gcc gcc-c++ kernel-headers cmake jq wget \
pkg-config clang clang-libs llvm-libs \
openssl-devel findutils fontconfig-devel \
lato-fonts
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain "${RUST_VER}"
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
WORKDIR /opt/darkfi
COPY . /opt/darkfi
RUN make clean
RUN rm -rf ./target/
RUN bash -c 'make -j test && make -j all'
# 3. stage
FROM ${OS_VER}
RUN dnf -y install openssl lato-fonts \
&& dnf clean all \
&& rm -rf /var/cache/dnf
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 ./