Compare commits

..

1 Commits

Author SHA1 Message Date
8aa30b6fe0 debugs 2024-05-06 18:50:34 +00:00
3 changed files with 44 additions and 27 deletions

View File

@ -33,19 +33,18 @@ 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 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
RUN make buildall
#####################################
FROM ubuntu:20.04 AS lotus-base
@ -70,11 +69,12 @@ RUN useradd -r -u 532 -U fc \
FROM lotus-base AS lotus
MAINTAINER Lotus Development Team
COPY --from=lotus-builder \
/usr/local/bin/lotus \
/usr/local/bin/lotus-shed \
/usr/local/bin/
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 /
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,42 +89,52 @@ 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
ARG DOCKER_LOTUS_IMPORT_SNAPSHOT=https://forest-archive.chainsafe.dev/latest/mainnet/
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT=${DOCKER_LOTUS_IMPORT_SNAPSHOT}
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
ENV WALLET_PATH /var/lib/lotus-wallet
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 scripts/docker-lotus-entrypoint.sh /docker-lotus-entrypoint.sh
RUN chmod +x /docker-lotus-entrypoint.sh
COPY --from=lotus-builder /opt/filecoin/lotus-fountain /usr/local/bin/
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-miner
VOLUME /var/lib/lotus-worker
VOLUME /var/lib/lotus-wallet
VOLUME /var/lib/lotus-provider
EXPOSE 1234
EXPOSE 1235
EXPOSE 2345
EXPOSE 3456
EXPOSE 1777

View File

@ -2,7 +2,9 @@ package main
import (
"context"
"fmt"
"os"
"strings"
"github.com/fatih/color"
logging "github.com/ipfs/go-log/v2"
@ -24,6 +26,11 @@ var log = logging.Logger("main")
var AdvanceBlockCmd *cli.Command
func main() {
libp2p_addr := os.Getenv("LOTUS_LIBP2P_LISTENADDRESSES")
fmt.Println("env", libp2p_addr)
if len(libp2p_addr) > 0 && strings.Contains(libp2p_addr, ",") {
fmt.Println("env var is csv")
}
api.RunningNodeType = api.NodeFull
lotuslog.SetupLogLevels()

View File

@ -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 daemon $@
exec /usr/local/bin/lotus $@