From b236124ef85defae6e5edb1cf2e3c04c103b0046 Mon Sep 17 00:00:00 2001 From: Devrandom Date: Sun, 1 Oct 2023 15:40:05 +0200 Subject: [PATCH 1/2] docker 20 / compose 1.29 compatibility --- bitcoind/Dockerfile | 4 ++-- docker-compose.yml | 3 ++- lightningd/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bitcoind/Dockerfile b/bitcoind/Dockerfile index feb830d..2d5f4b6 100644 --- a/bitcoind/Dockerfile +++ b/bitcoind/Dockerfile @@ -1,5 +1,5 @@ # Build stage for Bitcoin Core -FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as bitcoin-core +FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as bitcoin-core ARG TARGETPLATFORM @@ -84,7 +84,7 @@ RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0 # Runtime binaries and setup stage -FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as runner +FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner ARG UID=100 ARG GID=101 diff --git a/docker-compose.yml b/docker-compose.yml index 8760f56..0120eae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ services: bitcoin-core: build: dockerfile: ./bitcoind/Dockerfile + context: . image: bitcoind container_name: bitcoind-test volumes: @@ -19,6 +20,7 @@ services: core-lightning: build: dockerfile: ./lightningd/Dockerfile + context: . image: lightningd container_name: lightningd-test command: @@ -33,7 +35,6 @@ services: depends_on: bitcoin-core: condition: service_healthy - restart: true env_file: - ./assets/testnet-env environment: diff --git a/lightningd/Dockerfile b/lightningd/Dockerfile index e831aee..0a43b26 100644 --- a/lightningd/Dockerfile +++ b/lightningd/Dockerfile @@ -1,5 +1,5 @@ # build stage for core lightning and clboss -FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as builder +FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as bitcoin-core ARG TARGETPLATFORM @@ -50,7 +50,7 @@ RUN git clone --recurse-submodules https://github.com/ZmnSCPxj/clboss.git /clbos make install # final stage with runtime dependencies and pkgs -FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM}} alpine:3.18 as runner +FROM --platform=${TARGETPLATFORM:-${BUILDPLATFORM:-linux/amd64}} alpine:3.18 as runner LABEL maintainer.0="Lakshya Singh (@king-11)" \ maintainer.1="Dev Random (@devrandom01)" From bee2c59858f972538c0e94d390491e753429fae6 Mon Sep 17 00:00:00 2001 From: Devrandom Date: Sun, 1 Oct 2023 16:03:05 +0200 Subject: [PATCH 2/2] work around gpg issue --- bitcoind/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bitcoind/Dockerfile b/bitcoind/Dockerfile index 2d5f4b6..4c4418d 100644 --- a/bitcoind/Dockerfile +++ b/bitcoind/Dockerfile @@ -19,7 +19,8 @@ RUN apk add \ sqlite-dev \ zeromq-dev -RUN set -ex \ +ENV GNUPGHOME=/root/.gnupg +RUN mkdir $GNUPGHOME && set -ex \ && for key in \ 152812300785C96444D3334D17565732E08E5E41 \ 0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \ @@ -46,6 +47,8 @@ RUN set -ex \ done && \ wget -O- https://raw.githubusercontent.com/Kvaciral/kvaciral/main/kvaciral.asc | gpg --import +RUN gpg -kv + ARG BITCOIN_VERSION=23.0 ARG BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION} ARG SHA256SUMS_HASH=aaff81ea001f499e8f6f3221387d7db960d71a3b7a4a2b1aaf2c8060bc94a391 @@ -53,7 +56,7 @@ ARG SHA256SUMS_HASH=aaff81ea001f499e8f6f3221387d7db960d71a3b7a4a2b1aaf2c8060bc94 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 --verify SHA256SUMS.asc SHA256SUMS +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