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
|
WORKDIR /build
|
||||||
|
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
apk add \
|
apk add \
|
||||||
build-base \
|
build-base \
|
||||||
cargo \
|
cargo \
|
||||||
git \
|
git \
|
||||||
grpc \
|
grpc \
|
||||||
protobuf \
|
protobuf \
|
||||||
protobuf-dev \
|
protobuf-dev \
|
||||||
rust
|
rust
|
||||||
|
|
||||||
ARG GIT_HASH=af02dac8b855c361d74234387d288a9591fad1d5
|
ARG GIT_HASH=af02dac8b855c361d74234387d288a9591fad1d5
|
||||||
RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git && \
|
RUN git clone https://gitlab.com/lightning-signer/validating-lightning-signer.git vls
|
||||||
cd validating-lightning-signer && \
|
RUN cd vls && \
|
||||||
git checkout $GIT_HASH
|
git checkout $GIT_HASH && \
|
||||||
|
cargo build --bin vlsd2 --release
|
||||||
RUN cd validating-lightning-signer && \
|
|
||||||
cargo build --bins --release
|
|
||||||
|
|
||||||
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner
|
||||||
|
|
||||||
@ -38,7 +36,7 @@ RUN apk update && \
|
|||||||
protobuf \
|
protobuf \
|
||||||
bind-tools
|
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
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
@ -46,11 +44,11 @@ RUN chmod +x /entrypoint.sh
|
|||||||
COPY vlsd2.toml /vlsd2.toml
|
COPY vlsd2.toml /vlsd2.toml
|
||||||
|
|
||||||
ENV VLS_DATA=/home/vls/.lightning-signer
|
ENV VLS_DATA=/home/vls/.lightning-signer
|
||||||
RUN mkdir "${VLS_DATA}"
|
RUN mkdir ${VLS_DATA}
|
||||||
RUN chown vls:vls "${VLS_DATA}"
|
RUN chown vls:vls ${VLS_DATA}
|
||||||
|
|
||||||
ENV REMOTE_SIGNER_ALLOWLIST=${VLS_DATA}/ALLOWLIST
|
ENV REMOTE_SIGNER_ALLOWLIST=${VLS_DATA}/ALLOWLIST
|
||||||
RUN touch "${REMOTE_SIGNER_ALLOWLIST}"
|
RUN touch ${REMOTE_SIGNER_ALLOWLIST}
|
||||||
|
|
||||||
VOLUME ["${VLS_DATA}"]
|
VOLUME ["${VLS_DATA}"]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user