| 
1 | 1 | FROM ubuntu:20.04 AS base  | 
2 | 2 | RUN rm -f /etc/apt/apt.conf.d/docker-clean  | 
3 |  | -RUN --mount=type=cache,target=/var/cache/apt apt-get update  | 
4 |  | -RUN --mount=type=cache,target=/var/cache/apt apt-get install -y --no-install-recommends hwloc ocl-icd-*  | 
 | 3 | +ARG DEBIAN_FRONTEND=noninteractive  | 
 | 4 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=shared apt-get update && apt-get install -y --no-install-recommends hwloc ocl-icd-* \  | 
 | 5 | +    && rm -rf /var/lib/apt/lists/*  | 
5 | 6 | 
 
  | 
6 | 7 | FROM base AS build  | 
7 |  | -RUN --mount=type=cache,target=/var/cache/apt DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends git curl rsync make ninja-build clang-9 jq python3-pip python-setuptools pkg-config opencl-headers libhwloc-dev  | 
 | 8 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=shared apt-get update && apt-get install -y --no-install-recommends git curl rsync make ninja-build clang-9 jq python3-pip python-setuptools pkg-config opencl-headers libhwloc-dev zlib1g-dev libbz2-dev liblzma-dev libssl-dev libxml2-dev \  | 
 | 9 | +    && rm -rf /var/lib/apt/lists/*  | 
8 | 10 | RUN pip3 install scikit-build cmake requests gitpython pyyaml  | 
9 | 11 | RUN curl -sL https://golang.org/dl/go1.17.3.linux-amd64.tar.gz | tar -xz -C /usr/local  | 
10 | 12 | ENV PATH="$PATH:/usr/local/go/bin"  | 
11 | 13 | COPY . /tmp/cpp-filecoin  | 
12 | 14 | RUN --mount=type=cache,target=/tmp/.hunter/_Base/Cache CC=clang-9 CXX=clang++-9 cmake /tmp/cpp-filecoin -B /tmp/build -G Ninja -D CMAKE_BUILD_TYPE=Release -D TESTING=OFF  | 
13 |  | -RUN --mount=type=cache,target=/tmp/.hunter/_Base/Cache CC=clang-9 cmake --build /tmp/build --target fuhon-node  | 
 | 15 | +RUN --mount=type=cache,target=/tmp/.hunter/_Base/Cache CC=clang-9 cmake --build /tmp/build --target fuhon-node fuhon-miner  | 
14 | 16 | 
 
  | 
15 |  | -FROM base  | 
 | 17 | +FROM base AS fuhon-miner  | 
 | 18 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=shared apt-get update && apt-get install -y --no-install-recommends libarchive13 libssl1.1 \  | 
 | 19 | +    && rm -rf /var/lib/apt/lists/*  | 
 | 20 | +# cmake built libarchive has API v17, but provided version is v13 (https://github.com/libarchive/libarchive/issues/1236)  | 
 | 21 | +RUN ln -s /lib/x86_64-linux-gnu/libarchive.so.13 /lib/x86_64-linux-gnu/libarchive.so.17  | 
 | 22 | +WORKDIR /opt/fuhon  | 
 | 23 | +COPY --from=build /tmp/build/bin/fuhon-miner /usr/local/bin  | 
 | 24 | +COPY docker/miner_entrypoint.sh /  | 
 | 25 | +RUN chmod +x /miner_entrypoint.sh  | 
 | 26 | +ENTRYPOINT ["/miner_entrypoint.sh"]  | 
 | 27 | +CMD ["fuhon-miner", "--repo", "fuhon-node-repo", "--miner-repo", "fuhon-miner-repo"]  | 
 | 28 | + | 
 | 29 | +FROM base AS fuhon-node  | 
16 | 30 | WORKDIR /opt/fuhon  | 
17 | 31 | COPY --from=build /tmp/build/bin/fuhon-node /usr/local/bin  | 
18 | 32 | EXPOSE 1234 2000  | 
19 |  | -COPY docker/entrypoint.sh /  | 
20 |  | -RUN chmod +x /entrypoint.sh  | 
21 |  | -ENTRYPOINT ["/entrypoint.sh"]  | 
 | 33 | +COPY docker/node_entrypoint.sh /  | 
 | 34 | +RUN chmod +x /node_entrypoint.sh  | 
 | 35 | +ENTRYPOINT ["/node_entrypoint.sh"]  | 
 | 36 | +CMD ["fuhon-node", "--config", "fuhon-node.cfg", "--genesis" ,"genesis.car", "--repo", "fuhon-node-repo"]  | 
0 commit comments