From 758dd1396500900e8111e9b125ceaa0fb8b29b7a Mon Sep 17 00:00:00 2001 From: "jonathan@vulcanize.io" Date: Wed, 8 May 2024 17:23:37 +0000 Subject: [PATCH] tweaks to support SO --- Dockerfile | 62 +++++++++++++----------------- scripts/docker-lotus-entrypoint.sh | 2 +- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae83911d3..baa5033c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,18 +33,19 @@ RUN set -eux; \ COPY ./ /opt/filecoin WORKDIR /opt/filecoin -RUN scripts/docker-git-state-check.sh - -### make configurable filecoin-ffi build ARG FFI_BUILD_FROM_SOURCE=0 ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE} -RUN make clean deps +#RUN make clean deps ARG RUSTFLAGS="" ARG GOFLAGS="" -RUN make buildall +RUN make clean deps && \ + make lotus lotus-shed lotus-stats && \ + install -C ./lotus /usr/local/bin/lotus && \ + install -C ./lotus-shed /usr/local/bin/lotus-shed && \ + install -C ./lotus-stats /usr/local/bin/lotus-stats ##################################### FROM ubuntu:20.04 AS lotus-base @@ -69,12 +70,11 @@ RUN useradd -r -u 532 -U fc \ FROM lotus-base AS lotus MAINTAINER Lotus Development Team -COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/ -COPY scripts/docker-lotus-entrypoint.sh / +COPY --from=lotus-builder \ + /usr/local/bin/lotus \ + /usr/local/bin/lotus-shed \ + /usr/local/bin/ -ARG DOCKER_LOTUS_IMPORT_SNAPSHOT https://snapshots.mainnet.filops.net/minimal/latest -ENV DOCKER_LOTUS_IMPORT_SNAPSHOT ${DOCKER_LOTUS_IMPORT_SNAPSHOT} ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters ENV LOTUS_PATH /var/lib/lotus ENV DOCKER_LOTUS_IMPORT_WALLET "" @@ -89,52 +89,42 @@ USER fc EXPOSE 1234 -ENTRYPOINT ["/docker-lotus-entrypoint.sh"] CMD ["-help"] ##################################### FROM lotus-base AS lotus-all-in-one +# Install netcat for healthcheck +RUN apt-get update && apt-get install -y netcat && apt-get install -y iproute2 + ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters -ENV LOTUS_MINER_PATH /var/lib/lotus-miner ENV LOTUS_PATH /var/lib/lotus -ENV LOTUS_WORKER_PATH /var/lib/lotus-worker -ENV WALLET_PATH /var/lib/lotus-wallet + +ARG DOCKER_LOTUS_IMPORT_SNAPSHOT=https://forest-archive.chainsafe.dev/latest/mainnet/ +ENV DOCKER_LOTUS_IMPORT_SNAPSHOT=${DOCKER_LOTUS_IMPORT_SNAPSHOT} COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-seed /usr/local/bin/ COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-wallet /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-gateway /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-miner /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-worker /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-provider /usr/local/bin/ COPY --from=lotus-builder /opt/filecoin/lotus-stats /usr/local/bin/ -COPY --from=lotus-builder /opt/filecoin/lotus-fountain /usr/local/bin/ +COPY scripts/docker-lotus-entrypoint.sh /docker-lotus-entrypoint.sh +RUN chmod +x /docker-lotus-entrypoint.sh RUN mkdir /var/tmp/filecoin-proof-parameters RUN mkdir /var/lib/lotus -RUN mkdir /var/lib/lotus-miner -RUN mkdir /var/lib/lotus-worker -RUN mkdir /var/lib/lotus-wallet -RUN mkdir /var/lib/lotus-provider + RUN chown fc: /var/tmp/filecoin-proof-parameters RUN chown fc: /var/lib/lotus -RUN chown fc: /var/lib/lotus-miner -RUN chown fc: /var/lib/lotus-worker -RUN chown fc: /var/lib/lotus-wallet -RUN chown fc: /var/lib/lotus-provider VOLUME /var/tmp/filecoin-proof-parameters VOLUME /var/lib/lotus -VOLUME /var/lib/lotus-miner -VOLUME /var/lib/lotus-worker -VOLUME /var/lib/lotus-wallet -VOLUME /var/lib/lotus-provider +#VOLUME /var/lib/lotus-miner +#VOLUME /var/lib/lotus-worker +#VOLUME /var/lib/lotus-wallet + + EXPOSE 1234 -EXPOSE 2345 -EXPOSE 3456 -EXPOSE 1777 +EXPOSE 1235 + diff --git a/scripts/docker-lotus-entrypoint.sh b/scripts/docker-lotus-entrypoint.sh index ed405da0c..c0887e32f 100755 --- a/scripts/docker-lotus-entrypoint.sh +++ b/scripts/docker-lotus-entrypoint.sh @@ -16,4 +16,4 @@ if [ ! -z $DOCKER_LOTUS_IMPORT_WALLET ]; then /usr/local/bin/lotus-shed keyinfo import "$DOCKER_LOTUS_IMPORT_WALLET" fi -exec /usr/local/bin/lotus $@ +exec /usr/local/bin/lotus daemon $@