vls: separate repo download and build
- flexbile build option with network caching - build only vlsd2 not all - improve build speed Signed-off-by: Lakshya Singh <lakshay.singh1108@gmail.com>
This commit is contained in:
parent
6e7178a4c4
commit
35da6dafe0
@ -3,22 +3,20 @@ 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
|
||||
RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls
|
||||
RUN cd vls && \
|
||||
git checkout $GIT_HASH && \
|
||||
cargo build --bin vlsd2 --release
|
||||
|
||||
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
||||
|
||||
@ -38,7 +36,7 @@ RUN apk update && \
|
||||
protobuf \
|
||||
bind-tools
|
||||
|
||||
COPY --from=builder /build/validating-lightning-signer/target/release/vlsd2 /usr/local/bin/vlsd2
|
||||
COPY --from=builder /build/vls/target/release/vlsd2 /usr/local/bin/vlsd2
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
@ -46,11 +44,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}"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user