Kaynağa Gözat

Dockerfile for Ubuntu, tested with a commit from October, build worked, but tests fail and last commits even fail to build

spital 3 yıl önce
ebeveyn
işleme
ec9bbcf07f
1 değiştirilmiş dosya ile 50 ekleme ve 0 silme
  1. 50 0
      contrib/docker/Dockerfile.ubuntu

+ 50 - 0
contrib/docker/Dockerfile.ubuntu

@@ -0,0 +1,50 @@
+
+# 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.64
+
+ARG RUST_VER=1.65       # stable nightly beta 1.64
+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 cargo search whatever  # creates .cargo cache
+
+FROM rust_builder
+
+RUN mkdir /opt/darkfi
+
+COPY . /opt/darkfi
+
+WORKDIR /opt/darkfi
+
+RUN make clean
+
+RUN rm -rf ./target/*
+
+RUN bash -c 'make -j test &&  make -j all'
+
+# 2. stage
+FROM ${REPOSITORY}:${RUN_OS_VER}
+
+RUN apt-get -y update && apt-get install -y openssl fonts-lato \
+  && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /opt/darkfi
+
+COPY --from=builder /opt/darkfi/drk /opt/darkfi/darkfid /opt/darkfi/tau /opt/darkfi/taud \
+  /opt/darkfi/ircd /opt/darkfi/dnetview /opt/darkfi/darkotc /opt/darkfi/darkwikid \
+  /opt/darkfi/darkwiki /opt/darkfi/zkas  ./
+