diff --git a/Dockerfile b/Dockerfile index 01c3f86814ed..a22865973754 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,13 @@ RUN mkdir /opt/litecoin && cd /opt/litecoin \ && tar -xzvf litecoin.tar.gz $BD/litecoin-cli --strip-components=1 --exclude=*-qt \ && rm litecoin.tar.gz +ENV DESCHASHPLUGIN_URL https://github.com/fiatjaf/sparko/releases/download/invoicewithdescriptionhash-v1.2/invoicewithdescriptionhash_linux_amd64 +ENV DESCHASHPLUGIN_SHA256 E3EA0D076A26D774BA68D1D5E3FE48D267CE02D077933EF3CBAE1FC39007FB11 +RUN mkdir /opt/deschashplugin && cd /opt/deschashplugin \ + && wget -qO invoicewithdescriptionhash "$DESCHASHPLUGIN_URL" \ + && echo "$DESCHASHPLUGIN_SHA256 invoicewithdescriptionhash" | sha256sum -c - \ + && chmod a+x invoicewithdescriptionhash + FROM debian:buster-slim as builder ENV LIGHTNINGD_VERSION=master @@ -109,11 +116,15 @@ ENV LIGHTNINGD_PORT=9735 ENV LIGHTNINGD_NETWORK=bitcoin RUN mkdir $LIGHTNINGD_DATA && \ + mkdir /etc/bundledplugins && \ + mkdir $LIGHTNINGD_DATA/plugins && \ touch $LIGHTNINGD_DATA/config VOLUME [ "/root/.lightning" ] COPY --from=builder /tmp/lightning_install/ /usr/local/ COPY --from=downloader /opt/bitcoin/bin /usr/bin COPY --from=downloader /opt/litecoin/bin /usr/bin +COPY --from=downloader /opt/deschashplugin $LIGHTNINGD_DATA/plugins +COPY --from=downloader /opt/deschashplugin /etc/bundledplugins COPY tools/docker-entrypoint.sh entrypoint.sh EXPOSE 9735 9835 diff --git a/contrib/linuxarm32v7.Dockerfile b/contrib/linuxarm32v7.Dockerfile index 36f220e3ba22..88a87ec7f303 100644 --- a/contrib/linuxarm32v7.Dockerfile +++ b/contrib/linuxarm32v7.Dockerfile @@ -45,6 +45,13 @@ RUN mkdir /opt/litecoin && cd /opt/litecoin \ && tar -xzvf litecoin.tar.gz $BD/litecoin-cli --strip-components=1 --exclude=*-qt \ && rm litecoin.tar.gz +ENV DESCHASHPLUGIN_URL https://github.com/fiatjaf/sparko/releases/download/invoicewithdescriptionhash-v1.2/invoicewithdescriptionhash_linux_arm +ENV DESCHASHPLUGIN_SHA256 D268BFAD4CCDA9670A17ED9FACC79F81CDD22756C76ED4A94BE59282E4E819F0 +RUN mkdir /opt/deschashplugin && cd /opt/deschashplugin \ + && wget -qO invoicewithdescriptionhash "$DESCHASHPLUGIN_URL" \ + && echo "$DESCHASHPLUGIN_SHA256 invoicewithdescriptionhash" | sha256sum -c - \ + && chmod a+x invoicewithdescriptionhash + FROM debian:buster-slim as builder ENV LIGHTNINGD_VERSION=master @@ -104,11 +111,15 @@ ENV LIGHTNINGD_RPC_PORT=9835 ENV LIGHTNINGD_PORT=9735 RUN mkdir $LIGHTNINGD_DATA && \ + mkdir /etc/bundledplugins && \ + mkdir $LIGHTNINGD_DATA/plugins && \ touch $LIGHTNINGD_DATA/config VOLUME [ "/root/.lightning" ] COPY --from=builder /tmp/lightning_install/ /usr/local/ COPY --from=downloader /opt/bitcoin/bin /usr/bin COPY --from=downloader /opt/litecoin/bin /usr/bin +COPY --from=downloader /opt/deschashplugin $LIGHTNINGD_DATA/plugins +COPY --from=downloader /opt/deschashplugin /etc/bundledplugins COPY tools/docker-entrypoint.sh entrypoint.sh EXPOSE 9735 9835 diff --git a/contrib/linuxarm64v8.Dockerfile b/contrib/linuxarm64v8.Dockerfile index 5f5bf88236bd..bd2b11c20559 100644 --- a/contrib/linuxarm64v8.Dockerfile +++ b/contrib/linuxarm64v8.Dockerfile @@ -45,6 +45,13 @@ RUN mkdir /opt/litecoin && cd /opt/litecoin \ && tar -xzvf litecoin.tar.gz $BD/litecoin-cli --strip-components=1 --exclude=*-qt \ && rm litecoin.tar.gz +ENV DESCHASHPLUGIN_URL https://github.com/fiatjaf/sparko/releases/download/invoicewithdescriptionhash-v1.2/invoicewithdescriptionhash_linux_arm64 +ENV DESCHASHPLUGIN_SHA256 3953CD545D7B40CBCDF3C1CBF4AA779832290A95DDBF319E992C2692BC1C3F39 +RUN mkdir /opt/deschashplugin && cd /opt/deschashplugin \ + && wget -qO invoicewithdescriptionhash "$DESCHASHPLUGIN_URL" \ + && echo "$DESCHASHPLUGIN_SHA256 invoicewithdescriptionhash" | sha256sum -c - \ + && chmod a+x invoicewithdescriptionhash + FROM debian:buster-slim as builder ENV LIGHTNINGD_VERSION=master @@ -104,11 +111,15 @@ ENV LIGHTNINGD_RPC_PORT=9835 ENV LIGHTNINGD_PORT=9735 RUN mkdir $LIGHTNINGD_DATA && \ + mkdir /etc/bundledplugins && \ + mkdir $LIGHTNINGD_DATA/plugins && \ touch $LIGHTNINGD_DATA/config VOLUME [ "/root/.lightning" ] COPY --from=builder /tmp/lightning_install/ /usr/local/ COPY --from=downloader /opt/bitcoin/bin /usr/bin COPY --from=downloader /opt/litecoin/bin /usr/bin +COPY --from=downloader /opt/deschashplugin $LIGHTNINGD_DATA/plugins +COPY --from=downloader /opt/deschashplugin /etc/bundledplugins COPY tools/docker-entrypoint.sh entrypoint.sh EXPOSE 9735 9835 diff --git a/tools/docker-entrypoint.sh b/tools/docker-entrypoint.sh index 8dc68be1996c..7604eaf243bf 100755 --- a/tools/docker-entrypoint.sh +++ b/tools/docker-entrypoint.sh @@ -91,6 +91,10 @@ if ! grep -q "^rpc-file=" "$LIGHTNINGD_DATA/config"; then echo "rpc-file=$LIGHTNINGD_DATA/lightning-rpc added to $LIGHTNINGD_DATA/config" fi +echo "Installing bundled plugins" +mkdir "$LIGHTNINGD_DATA/plugins" +cp -u /etc/bundledplugins/* $LIGHTNINGD_DATA/plugins/ + echo "C-Lightning starting, listening on port ${LIGHTNINGD_PORT}" if [ "$EXPOSE_TCP" == "true" ]; then set -m