Skip to content

Commit e430d33

Browse files
authored
fix: Dockerfile non-interactive snapshot import (#11579)
1 parent 3685cb5 commit e430d33

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ COPY --from=lotus-builder /opt/filecoin/lotus /usr/local/bin/
7373
COPY --from=lotus-builder /opt/filecoin/lotus-shed /usr/local/bin/
7474
COPY scripts/docker-lotus-entrypoint.sh /
7575

76-
ARG DOCKER_LOTUS_IMPORT_SNAPSHOT https://snapshots.mainnet.filops.net/minimal/latest
76+
ARG DOCKER_LOTUS_IMPORT_SNAPSHOT=https://forest-archive.chainsafe.dev/latest/mainnet/
7777
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT ${DOCKER_LOTUS_IMPORT_SNAPSHOT}
7878
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
7979
ENV LOTUS_PATH /var/lib/lotus

scripts/docker-lotus-entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
#!/usr/bin/env bash
22

3-
if [ ! -z $DOCKER_LOTUS_IMPORT_SNAPSHOT ]; then
3+
if [ ! -z "$DOCKER_LOTUS_IMPORT_SNAPSHOT" ]; then
44
GATE="$LOTUS_PATH"/date_initialized
55
# Don't init if already initialized.
66
if [ ! -f "$GATE" ]; then
77
echo importing minimal snapshot
8-
/usr/local/bin/lotus daemon --import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" --halt-after-import
8+
/usr/local/bin/lotus daemon \
9+
--import-snapshot "$DOCKER_LOTUS_IMPORT_SNAPSHOT" \
10+
--remove-existing-chain=false \
11+
--halt-after-import
912
# Block future inits
1013
date > "$GATE"
1114
fi
1215
fi
1316

1417
# import wallet, if provided
15-
if [ ! -z $DOCKER_LOTUS_IMPORT_WALLET ]; then
18+
if [ ! -z "$DOCKER_LOTUS_IMPORT_WALLET" ]; then
1619
/usr/local/bin/lotus-shed keyinfo import "$DOCKER_LOTUS_IMPORT_WALLET"
1720
fi
1821

0 commit comments

Comments
 (0)