Files
darkfi/contrib/docker/Dockerfile.ubuntu
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

52 lines
1.3 KiB
Docker

# 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.65
ARG RUST_VER=1.67 # stable nightly beta
ARG BUILD_OS_VER=22.04 # 20.04
ARG RUN_OS_VER=${BUILD_OS_VER}
ARG REPOSITORY=ubuntu
FROM ${REPOSITORY}:${BUILD_OS_VER} as rust_builder
ARG RUST_VER
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
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
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 ${REPOSITORY}:${RUN_OS_VER}
RUN apt-get -y update && apt-get install -y openssl fonts-lato \
&& 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 ./