Merge branch 'platform-and-keys' into 'main'
multi platform build support and sha256sum check See merge request lightning-signer/vls-container!2
This commit is contained in:
commit
dd08acd01e
@ -1,5 +1,7 @@
|
|||||||
# Build stage for Bitcoin Core
|
# Build stage for Bitcoin Core
|
||||||
FROM alpine as bitcoin-core
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as bitcoin-core
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
|
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
@ -46,11 +48,13 @@ RUN set -ex \
|
|||||||
|
|
||||||
ENV BITCOIN_VERSION=23.0
|
ENV BITCOIN_VERSION=23.0
|
||||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
ENV 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
|
||||||
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
|
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 wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
|
||||||
RUN gpg --verify SHA256SUMS.asc SHA256SUMS
|
RUN gpg --verify SHA256SUMS.asc SHA256SUMS
|
||||||
|
RUN echo "${SHA256SUMS_HASH} SHA256SUMS" | sha256sum -c -
|
||||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
||||||
RUN tar -xzf *.tar.gz
|
RUN tar -xzf *.tar.gz
|
||||||
|
|
||||||
@ -71,7 +75,7 @@ RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/incl
|
|||||||
--with-libs \
|
--with-libs \
|
||||||
--with-sqlite=yes \
|
--with-sqlite=yes \
|
||||||
--with-daemon
|
--with-daemon
|
||||||
RUN make -j`nproc`
|
RUN make -j $(nproc)
|
||||||
RUN make install
|
RUN make install
|
||||||
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
|
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
|
||||||
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
|
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
|
||||||
@ -79,8 +83,8 @@ RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
|
|||||||
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
|
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
|
||||||
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
|
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
|
||||||
|
|
||||||
# Build stage for compiled artifacts
|
# Runtime binaries and setup stage
|
||||||
FROM alpine
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as runner
|
||||||
|
|
||||||
ARG UID=100
|
ARG UID=100
|
||||||
ARG GID=101
|
ARG GID=101
|
||||||
@ -100,8 +104,8 @@ RUN apk --no-cache add \
|
|||||||
libzmq
|
libzmq
|
||||||
|
|
||||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||||
ENV BITCOIN_VERSION=23.0
|
ARG BITCOIN_VERSION=23.0
|
||||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||||
|
|
||||||
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-cli /usr/bin/bitcoin-cli
|
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-cli /usr/bin/bitcoin-cli
|
||||||
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-tx /usr/bin/bitcoin-tx
|
COPY --from=bitcoin-core ${BITCOIN_PREFIX}/bin/bitcoin-tx /usr/bin/bitcoin-tx
|
||||||
@ -115,7 +119,7 @@ COPY assets/bitcoin.conf /bitcoin.conf
|
|||||||
COPY bitcoind/healthcheck.sh /healthcheck.sh
|
COPY bitcoind/healthcheck.sh /healthcheck.sh
|
||||||
RUN chmod +x /healthcheck.sh
|
RUN chmod +x /healthcheck.sh
|
||||||
|
|
||||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
VOLUME ["${BITCOIN_DATA}"]
|
||||||
|
|
||||||
EXPOSE 8332 8333 18332 18333 18444
|
EXPOSE 8332 8333 18332 18333 18444
|
||||||
|
|
||||||
@ -124,7 +128,7 @@ RUN chown -R bitcoin:bitcoin "${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}"
|
||||||
|
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
FROM alpine:3.16 as builder
|
# build stage for core lightning and clboss
|
||||||
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as builder
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
@ -45,7 +48,9 @@ RUN git clone -b 2023-09-gnuc-version --recurse-submodules https://github.com/ks
|
|||||||
make -j $(nproc) && \
|
make -j $(nproc) && \
|
||||||
make install
|
make install
|
||||||
|
|
||||||
FROM alpine:3.16 as runner
|
# final stage with runtime dependencies and pkgs
|
||||||
|
FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as runner
|
||||||
|
|
||||||
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
LABEL maintainer.0="Lakshya Singh (@king-11)" \
|
||||||
maintainer.1="Dev Random (@devrandom01)"
|
maintainer.1="Dev Random (@devrandom01)"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user