diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fed5c56 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/docker-compose* +**/Dockerfile* +**/*.Dockerfile +LICENSE +README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8a8808f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,57 @@ +stages: + - build + - test + +default: + image: docker:24.0.7 + services: + - docker:24.0.7-dind + before_script: + - docker version + - docker compose version + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + +variables: + VLS_CONTAINER_REGISTRY: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME + CACHE: $CI_REGISTRY_IMAGE/cache + CACHE_TAG: $CI_COMMIT_REF_SLUG + IMAGE_TAG: $CI_COMMIT_SHA + +build_bitcoin: + tags: [ saas-linux-large-amd64 ] + stage: build + script: + - ./scripts/build_image_cache.sh bitcoind +build_core_lightning: + tags: [ saas-linux-large-amd64 ] + stage: build + script: + - ./scripts/build_image_cache.sh lightningd +build_txoo: + tags: [ saas-linux-medium-amd64 ] + stage: build + script: + - ./scripts/build_image_cache.sh txood +build_vls: + tags: [ saas-linux-large-amd64 ] + stage: build + script: + - ./scripts/build_image_cache.sh vlsd +compose: + tags: [ saas-linux-medium-amd64 ] + stage: test + variables: + BUILDER: compose_builder + before_script: + - docker volume create bitcoin_data + - docker volume create lightning_data + - docker volume create txoo_data + - docker volume create vls_data + - docker buildx create --name=$BUILDER --use + script: + - echo "IMAGE_TAG=${IMAGE_TAG}" > .env + - ./scripts/build_from_cache.sh bitcoind + - ./scripts/build_from_cache.sh lightningd + - ./scripts/build_from_cache.sh txood + - ./scripts/build_from_cache.sh vlsd + - docker compose --profile vls up -d --wait --wait-timeout 120 --build diff --git a/README.md b/README.md index 7bea844..fcede27 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ docker container exec lightningd-test lightning-cli --testnet summary - [x] standalone docker image for `lightningd` - [x] standalone docker image for `bitcoind` - [ ] supporting signet -- [ ] Profile configuration to run `vls` +- [x] Profile configuration to run `vls` - [ ] Healthcheck for `txoo` - [ ] Healthcheck for `vls` - [ ] Lightning Storage Server Dockerfile and Compose Service diff --git a/bitcoind/Dockerfile b/bitcoind/Dockerfile index ed23efd..1663d4b 100644 --- a/bitcoind/Dockerfile +++ b/bitcoind/Dockerfile @@ -53,21 +53,21 @@ ARG BITCOIN_VERSION=23.0 ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION} ARG SHA256SUMS_HASH=aaff81ea001f499e8f6f3221387d7db960d71a3b7a4a2b1aaf2c8060bc94a391 -RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS -RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc -RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz -RUN gpg --batch --verify SHA256SUMS.asc SHA256SUMS -RUN echo "${SHA256SUMS_HASH} SHA256SUMS" | sha256sum -c - -RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c - -RUN tar -xzf *.tar.gz +RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS && \ + wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && \ + wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz && \ + gpg --batch --verify SHA256SUMS.asc SHA256SUMS && \ + echo "${SHA256SUMS_HASH} SHA256SUMS" | sha256sum -c - && \ + grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c - && \ + tar -xzf *.tar.gz WORKDIR /bitcoin-${BITCOIN_VERSION} -RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac -RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac -RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h -RUN ./autogen.sh -RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \ +RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac && \ + sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac && \ + sed -i s:sys/fcntl.h:fcntl.h: src/compat.h && \ + ./autogen.sh && \ + ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \ --prefix=${BITCOIN_PREFIX} \ --mandir=/usr/share/man \ --disable-tests \ @@ -78,13 +78,15 @@ RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/incl --with-libs \ --with-sqlite=yes \ --with-daemon -RUN make -j $(nproc) -RUN make install -RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli -RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx -RUN strip ${BITCOIN_PREFIX}/bin/bitcoind -RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a -RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0 + +RUN make -j $(nproc) && \ + make install && \ + strip ${BITCOIN_PREFIX}/bin/bitcoin-cli \ + ${BITCOIN_PREFIX}/bin/bitcoin-tx \ + ${BITCOIN_PREFIX}/bin/bitcoind \ + ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a \ + ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0 && \ + make clean # Runtime binaries and setup stage FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner @@ -95,8 +97,8 @@ ARG GID=101 LABEL maintainer.0="Lakshya Singh (@king-11)" \ maintainer.1="Dev Random (@devrandom01)" -RUN addgroup bitcoin --gid ${GID} --system -RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin +RUN addgroup bitcoin --gid ${GID} --system && \ + adduser --uid ${UID} --system bitcoin --ingroup bitcoin RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories RUN apk --no-cache add \ boost-filesystem \ @@ -133,7 +135,7 @@ ENTRYPOINT ["/entrypoint.sh"] RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}" -HEALTHCHECK --interval=60s --timeout=10s --start-period=30s \ +HEALTHCHECK --interval=10s --timeout=20s --start-period=30s \ CMD ["/bin/sh", "-c", "/healthcheck.sh"] CMD ["bitcoind"] diff --git a/docker-compose.regtest.yml b/docker-compose.regtest.yml index 7c4542d..afdc3c5 100644 --- a/docker-compose.regtest.yml +++ b/docker-compose.regtest.yml @@ -19,7 +19,6 @@ services: ports: - 19846:19846 environment: - - BITCOIN_CHAIN=regtest - VLS_NETWORK=regtest - BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:38332 diff --git a/docker-compose.yml b/docker-compose.yml index ee3182a..6ad17b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,14 +3,14 @@ services: bitcoin-core: build: context: ./bitcoind - image: bitcoind + image: bitcoind:${IMAGE_TAG:-latest} container_name: bitcoind-test volumes: - bitcoin_data:/home/bitcoin/.bitcoin expose: - 18332 networks: - LN_testing: + lightning: aliases: - bitcoind environment: @@ -19,7 +19,7 @@ services: core-lightning: build: context: ./lightningd - image: lightningd + image: lightningd:${IMAGE_TAG:-latest} container_name: lightningd-test command: - --conf=/home/lightning/.lightning/testnet-config @@ -30,12 +30,11 @@ services: - 19735 - 7701 networks: - - LN_testing + - lightning depends_on: bitcoin-core: condition: service_healthy environment: - - BITCOIN_CHAIN=test - BITCOIND_RPC_URL=http://rpcuser:VLSsigner1@bitcoind:18332 - RUST_LOG=info - VLS_NETWORK=testnet @@ -45,13 +44,13 @@ services: txoo: build: context: ./txood - image: txood + image: txood:${IMAGE_TAG:-latest} container_name: txood-test restart: unless-stopped command: - -r http://rpcuser:VLSsigner1@bitcoind:18332 networks: - - LN_testing + - lightning volumes: - txoo_data:/root/.txoo/ - bitcoin_data:/root/.bitcoin/ @@ -64,7 +63,7 @@ services: vls: build: context: ./vlsd - image: vlsd + image: vlsd:${IMAGE_TAG:-latest} container_name: vlsd-test profiles: - vls @@ -72,7 +71,7 @@ services: - --log-level=info - --connect=http://core-lightning:7701 networks: - - LN_testing + - lightning volumes: - vls_data:/home/vls/.lightning-signer environment: @@ -96,4 +95,4 @@ volumes: external: true networks: - LN_testing: + lightning: diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index 879ca72..464ef33 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -1,4 +1,4 @@ -# build stage for core lightning and clboss +# build stage for core lightning and its plugins FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as builder ARG TARGETPLATFORM @@ -27,53 +27,71 @@ RUN apk update && \ zlib-dev \ zlib-static -ARG CORE_LIGHTNING_GIT_HASH=bd9494c65be09e6f8ecb3bc49b50a859467a65fe -ARG CORE_LIGHTNING_REPO=https://github.com/lightning-signer/c-lightning.git -RUN git clone --recursive $CORE_LIGHTNING_REPO /repo && \ - cd /repo && \ +ARG CORE_LIGHTNING_GIT_HASH=bd9494c65be09e6f8ecb3bc49b50a859467a65fe \ + CORE_LIGHTNING_REPO=https://github.com/lightning-signer/c-lightning.git +RUN git clone --recursive $CORE_LIGHTNING_REPO core-lightning +RUN cd core-lightning && \ git checkout $CORE_LIGHTNING_GIT_HASH && \ ./configure --enable-static --prefix=/usr && \ make -j $(nproc) && \ - make install + make -j $(nproc) install && \ + make clean -RUN apk add \ - autoconf-archive \ - bind-tools \ - build-base \ - curl-dev \ - libev-dev \ - pkgconf \ - sqlite-dev +ARG PLUGINS_GIT_HASH=ce078bb74e10b5dea779fcd9fbe77e1d3e72db7a \ + PLUGINS_REPO=https://github.com/lightningd/plugins.git +RUN git clone $PLUGINS_REPO +RUN cd plugins && \ + git checkout $PLUGINS_GIT_HASH -ARG CLBOSS_GIT_HASH=9c050d61f01ffff4b7b5d295f708569dd71b55d3 -ARG CLBOSS_REPO=https://github.com/ZmnSCPxj/clboss.git -RUN git clone --recurse-submodules $CLBOSS_REPO /clboss && \ - cd /clboss && \ +FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as clboss_builder + +WORKDIR /build + +RUN apk update && \ + apk add \ + git \ + autoconf-archive \ + automake \ + bind-tools \ + build-base \ + curl-dev \ + libev-dev \ + libtool \ + pkgconf \ + sqlite-dev + +ARG CLBOSS_GIT_HASH=9c050d61f01ffff4b7b5d295f708569dd71b55d3 \ + CLBOSS_REPO=https://github.com/ZmnSCPxj/clboss.git +RUN git clone --recurse-submodules $CLBOSS_REPO clboss +RUN cd clboss && \ git checkout $CLBOSS_GIT_HASH && \ autoreconf -i && \ ./configure --prefix=/usr && \ make -j $(nproc) && \ - make install + make -j $(nproc) install && \ + make clean -ARG PLUGINS_GIT_HASH=ce078bb74e10b5dea779fcd9fbe77e1d3e72db7a -ARG PLUGINS_REPO=https://github.com/lightningd/plugins.git -RUN git clone $PLUGINS_REPO && \ - cd plugins && \ - git checkout $PLUGINS_GIT_HASH +FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as vls_builder -RUN apk add \ - cargo \ - rust \ - grpc \ - protobuf \ - protobuf-dev +WORKDIR /build -ARG VLS_GIT_HASH=af02dac8b855c361d74234387d288a9591fad1d5 -ARG VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git -RUN git clone $VLS_REPO && \ - cd validating-lightning-signer && \ +RUN apk update && \ + apk add \ + build-base \ + cargo \ + git \ + grpc \ + protobuf \ + protobuf-dev \ + rust + +ARG VLS_GIT_HASH=59544fd5b15658643acebdaf18886022db3d1071 \ + VLS_REPO=https://gitlab.com/lightning-signer/validating-lightning-signer.git +RUN git clone $VLS_REPO vls +RUN cd vls && \ git checkout $VLS_GIT_HASH && \ - cargo build --bins -r + cargo install --path ./vls-proxy --bin remote_hsmd_socket --profile release --root /usr/local/ && \ + cargo clean # final stage with runtime dependencies and pkgs FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner @@ -94,8 +112,8 @@ RUN apk update && \ curl-dev \ sqlite-dev -ARG LIGHTNINGD_UID=101 -ARG LIGHTNINGD_USER=lightning +ARG LIGHTNINGD_UID=101 \ + LIGHTNINGD_USER=lightning ARG LIGHTNINGD_HOME=/home/${LIGHTNINGD_USER} ENV LIGHTNINGD_DATA=${LIGHTNINGD_HOME}/.lightning \ LIGHTNINGD_RPC_PORT=9835 \ @@ -104,21 +122,19 @@ ENV LIGHTNINGD_DATA=${LIGHTNINGD_HOME}/.lightning \ RUN mkdir -p /usr/local/src/plugins -COPY --from=builder /usr/bin/lightningd /usr/bin/ -COPY --from=builder /usr/bin/lightning-cli /usr/bin/ -COPY --from=builder /usr/bin/lightning-hsmtool /usr/bin/ +COPY --from=builder /usr/bin/lightningd /usr/bin/lightning-cli /usr/bin/lightning-hsmtool /usr/bin/ COPY --from=builder /usr/libexec/c-lightning /usr/libexec/c-lightning COPY --from=builder /usr/share/man/man8 /usr/share/man/man8 COPY --from=builder /usr/share/doc/c-lightning /usr/share/doc/c-lightning -COPY --from=builder /usr/bin/clboss /usr/bin/clboss +COPY --from=clboss_builder /usr/bin/clboss /usr/bin/clboss COPY --from=builder /build/plugins/summary /usr/local/src/plugins/summary -COPY --from=builder /build/validating-lightning-signer/target/release/remote_hsmd_socket /usr/libexec/c-lightning/remote_hsmd_socket +COPY --from=vls_builder /usr/local/bin/remote_hsmd_socket /usr/libexec/c-lightning/remote_hsmd_socket RUN addgroup -S lightning && adduser -S lightning -G lightning && \ mkdir -p ${LIGHTNINGD_DATA} && \ chown -R lightning:lightning ${LIGHTNINGD_DATA} -COPY bitcoin.conf "${BITCOIND_HOME}"/bitcoin.conf +COPY bitcoin.conf ${BITCOIND_HOME}/bitcoin.conf COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh @@ -128,10 +144,10 @@ RUN chmod +x /healthcheck.sh VOLUME ["${LIGHTNINGD_DATA}"] -RUN mkdir -p "${BITCOIND_HOME}" && \ - chown -R lightning:lightning "${BITCOIND_HOME}" +RUN mkdir -p ${BITCOIND_HOME} && \ + chown -R lightning:lightning ${BITCOIND_HOME} -COPY bitcoin.conf "${BITCOIND_HOME}"/bitcoin.conf +COPY bitcoin.conf ${BITCOIND_HOME}/bitcoin.conf COPY testnet-config /testnet-config COPY regtest-config /regtest-config @@ -142,7 +158,7 @@ RUN pip3 install \ requests \ packaging -HEALTHCHECK --interval=10s --timeout=10s --start-period=15s \ +HEALTHCHECK --interval=5s --timeout=10s --start-period=5s \ CMD ["/bin/sh", "-c", "/healthcheck.sh"] ENTRYPOINT ["/entrypoint.sh"] diff --git a/lightningd/bitcoin.conf b/lightningd/bitcoin.conf deleted file mode 120000 index b1895bf..0000000 --- a/lightningd/bitcoin.conf +++ /dev/null @@ -1 +0,0 @@ -../bitcoind/bitcoin.conf \ No newline at end of file diff --git a/lightningd/bitcoin.conf b/lightningd/bitcoin.conf new file mode 100644 index 0000000..79be1bf --- /dev/null +++ b/lightningd/bitcoin.conf @@ -0,0 +1,23 @@ +## +## bitcoin.conf configuration file. Lines beginning with # are comments. +## + +server=1 +rpcallowip=0.0.0.0/0 +whitelist=0.0.0.0/0 +txindex=1 +blockfilterindex=1 + +[test] +rpcbind=0.0.0.0 +rpcuser=rpcuser +rpcpassword=VLSsigner1 +rpcport=18332 +port=18333 + +[regtest] +rpcbind=0.0.0.0 +rpcuser=rpcuser +rpcpassword=VLSsigner1 +rpcport=38332 +port=38333 diff --git a/lightningd/healthcheck.sh b/lightningd/healthcheck.sh index b214130..3766c35 100755 --- a/lightningd/healthcheck.sh +++ b/lightningd/healthcheck.sh @@ -2,13 +2,4 @@ set -ex -LIGHTNING_NETWORK="" - -case $BITCOIN_CHAIN in - "test") LIGHTNING_NETWORK=testnet ;; - "regtest") LIGHTNING_NETWORK=regtest ;; - "signet") LIGHTNING_NETWORK=signet ;; - *) echo "Invalid BITCOIN_CHAIN value: $BITCOIN_CHAIN" && exit 1 ;; -esac - -lightning-cli --network $LIGHTNING_NETWORK getinfo +lightning-cli --network $VLS_NETWORK summary diff --git a/scripts/build_from_cache.sh b/scripts/build_from_cache.sh new file mode 100755 index 0000000..2f50344 --- /dev/null +++ b/scripts/build_from_cache.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -ex + +SERVICE=$1 + +cd $SERVICE +docker build --load --builder $BUILDER --cache-from $CACHE/$SERVICE:$CACHE_TAG -t $SERVICE:$IMAGE_TAG . diff --git a/scripts/build_image_cache.sh b/scripts/build_image_cache.sh new file mode 100755 index 0000000..bbab802 --- /dev/null +++ b/scripts/build_image_cache.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -ex + +SERVICE=$1 + +docker buildx create --name=$SERVICE --use +cd $SERVICE + +docker build --load --builder=$SERVICE --cache-to type=registry,ref=$CACHE/$SERVICE:$CACHE_TAG --cache-from $CACHE/$SERVICE:$CACHE_TAG -t $SERVICE:$IMAGE_TAG . diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..b8bcb28 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,3 @@ +#!/usr/bin/sh + +cmp bitcoind/bitcoin.conf lightningd/bitcoin.conf diff --git a/txood/Dockerfile b/txood/Dockerfile index 9611794..bfa8b13 100644 --- a/txood/Dockerfile +++ b/txood/Dockerfile @@ -6,16 +6,16 @@ WORKDIR /build RUN apk update && \ apk add \ git \ - rust + rust \ + cargo -RUN apk add cargo - -ARG TXOO_GIT_HASH=528fa92e5def1b6cc19127f2242137bf6f13550d +ARG TXOO_GIT_HASH=1cfeecf5f806a04a12c97ca17c39566a1a24e732 ARG TXOO_REPO=https://gitlab.com/lightning-signer/txoo.git -RUN git clone --recurse-submodules $TXOO_REPO && \ - cd txoo && \ +RUN git clone --recurse-submodules $TXOO_REPO +RUN cd txoo && \ git checkout $TXOO_GIT_HASH && \ - cargo build --release -p txood + cargo install --path ./txood --bin txood --profile release --root /usr/local/ && \ + cargo clean # txoo runner FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner @@ -23,6 +23,8 @@ FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as LABEL maintainer.0="Lakshya Singh (@king-11)" \ maintainer.1="Dev Random (@devrandom01)" +ARG TXOO_DATA=/root/.txoo + RUN apk update && \ apk add \ build-base \ @@ -30,12 +32,12 @@ RUN apk update && \ libev-dev \ curl-dev -COPY --from=builder /build/txoo/target/release/txood /usr/bin/txood +COPY --from=builder /usr/local/bin/txood /usr/bin/txood COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -VOLUME ["/root/.txoo/"] +VOLUME ["${TXOO_DATA}"] ENTRYPOINT ["/entrypoint.sh"] CMD ["txood"] diff --git a/vlsd/Dockerfile b/vlsd/Dockerfile index 7705576..edd7e4a 100644 --- a/vlsd/Dockerfile +++ b/vlsd/Dockerfile @@ -3,22 +3,21 @@ FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as WORKDIR /build RUN apk update && \ - apk add \ - build-base \ - cargo \ - git \ - grpc \ - protobuf \ - protobuf-dev \ - rust + apk add \ + build-base \ + cargo \ + git \ + grpc \ + protobuf \ + protobuf-dev \ + rust -ARG GIT_HASH=af02dac8b855c361d74234387d288a9591fad1d5 -RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git && \ - cd validating-lightning-signer && \ - git checkout $GIT_HASH - -RUN cd validating-lightning-signer && \ - cargo build --bins --release +ARG GIT_HASH=59544fd5b15658643acebdaf18886022db3d1071 +RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls +RUN cd vls && \ + git checkout $GIT_HASH && \ + cargo install --path ./vls-proxy --bin vlsd2 --profile release --root /usr/local/ && \ + cargo clean FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner @@ -38,7 +37,7 @@ RUN apk update && \ protobuf \ bind-tools -COPY --from=builder /build/validating-lightning-signer/target/release/vlsd2 /usr/local/bin/vlsd2 +COPY --from=builder /usr/local/bin/vlsd2 /usr/local/bin/vlsd2 COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh @@ -46,11 +45,11 @@ RUN chmod +x /entrypoint.sh COPY vlsd2.toml /vlsd2.toml ENV VLS_DATA=/home/vls/.lightning-signer -RUN mkdir "${VLS_DATA}" -RUN chown vls:vls "${VLS_DATA}" +RUN mkdir ${VLS_DATA} +RUN chown vls:vls ${VLS_DATA} ENV REMOTE_SIGNER_ALLOWLIST=${VLS_DATA}/ALLOWLIST -RUN touch "${REMOTE_SIGNER_ALLOWLIST}" +RUN touch ${REMOTE_SIGNER_ALLOWLIST} VOLUME ["${VLS_DATA}"]