vls: docker image, asssets and entrypoint
Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
parent
cd2a0f653f
commit
4abc404246
1
assets/vlsd2.toml
Normal file
1
assets/vlsd2.toml
Normal file
@ -0,0 +1 @@
|
|||||||
|
datadir = "/home/vls/.lightning-signer"
|
@ -129,7 +129,7 @@ VOLUME ["${BITCOIN_DATA}"]
|
|||||||
|
|
||||||
USER bitcoin
|
USER bitcoin
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||||
|
|
||||||
|
63
vlsd/Dockerfile
Normal file
63
vlsd/Dockerfile
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as builder
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
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
|
||||||
|
|
||||||
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
||||||
|
|
||||||
|
ARG UID=100
|
||||||
|
ARG GID=101
|
||||||
|
|
||||||
|
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||||
|
maintainer.1="Dev Random (@devrandom01)"
|
||||||
|
|
||||||
|
RUN addgroup vls --gid ${GID} --system
|
||||||
|
RUN adduser --uid ${UID} --system vls --ingroup vls
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add \
|
||||||
|
build-base \
|
||||||
|
curl-dev \
|
||||||
|
protobuf \
|
||||||
|
bind-tools
|
||||||
|
|
||||||
|
COPY --from=builder /build/validating-lightning-signer/target/release/vlsd2 /usr/local/bin/vlsd2
|
||||||
|
|
||||||
|
COPY vlsd/entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
COPY assets/vlsd2.toml /vlsd2.toml
|
||||||
|
|
||||||
|
ENV VLS_DATA=/home/vls/.lightning-signer
|
||||||
|
RUN mkdir "${VLS_DATA}"
|
||||||
|
RUN chown vls:vls "${VLS_DATA}"
|
||||||
|
|
||||||
|
ENV REMOTE_SIGNER_ALLOWLIST=${VLS_DATA}/ALLOWLIST
|
||||||
|
RUN touch "${REMOTE_SIGNER_ALLOWLIST}"
|
||||||
|
|
||||||
|
VOLUME ["${VLS_DATA}"]
|
||||||
|
|
||||||
|
USER vls
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
|
RUN vlsd2 --git-desc
|
||||||
|
|
||||||
|
CMD ["vlsd2"]
|
20
vlsd/entrypoint.sh
Executable file
20
vlsd/entrypoint.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cp /vlsd2.toml $VLS_DATA/
|
||||||
|
sed -i "1s/^/network = \"$VLS_NETWORK\"\n/" $VLS_DATA/vlsd2.toml
|
||||||
|
|
||||||
|
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||||
|
echo "$0: assuming arguments for vlsd2"
|
||||||
|
|
||||||
|
set -- vlsd2 "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "vlsd2" ]; then
|
||||||
|
echo "$0: setting config to $VLS_DATA/vlsd2.toml"
|
||||||
|
|
||||||
|
set -- "$@" --config=$VLS_DATA/vlsd2.toml
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user