diff --git a/.docker/6000-privnet-blocks.acc.gz b/.docker/6000-privnet-blocks.acc.gz new file mode 100644 index 000000000..b4d0213bb Binary files /dev/null and b/.docker/6000-privnet-blocks.acc.gz differ diff --git a/.docker/privnet-entrypoint.sh b/.docker/privnet-entrypoint.sh new file mode 100755 index 000000000..db3c609ed --- /dev/null +++ b/.docker/privnet-entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +if test -f /6000-privnet-blocks.acc.gz; then + gunzip /6000-privnet-blocks.acc.gz + /usr/bin/neo-go db restore -i /6000-privnet-blocks.acc +fi +/usr/bin/neo-go "$@" diff --git a/Dockerfile b/Dockerfile index 2fc68c4e3..fea8deda5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN set -x \ && go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli # Executable image -FROM scratch +FROM alpine ARG VERSION LABEL version=$VERSION @@ -30,9 +30,11 @@ LABEL version=$VERSION WORKDIR / COPY --from=builder /neo-go/config /config +COPY --from=builder /neo-go/.docker/6000-privnet-blocks.acc.gz / +COPY --from=builder /neo-go/.docker/privnet-entrypoint.sh /usr/bin/privnet-entrypoint.sh COPY --from=builder /go/bin/neo-go /usr/bin/neo-go COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -ENTRYPOINT ["/usr/bin/neo-go"] +ENTRYPOINT ["/usr/bin/privnet-entrypoint.sh"] -CMD ["node", "--config-path", "/config", "--testnet"] +CMD ["node", "--config-path", "/config", "--privnet"]