diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ca6a39..63123c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,14 @@ on: jobs: build: - name: Build v25.1.knots20231115 + name: Build ${{ matrix.knots-version }} runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + knots-version: + - v25.1.knots20231115 + - v26.1.knots20240325 steps: - uses: actions/checkout@v3 - uses: docker/setup-qemu-action@v3 @@ -20,10 +26,10 @@ jobs: password: ${{ secrets.DOCKER_HUB_PASS }} - uses: docker/build-push-action@v5 with: - cache-from: type=registry,ref=1maa/bitcoin:v25.1.knots20231115 + cache-from: type=registry,ref=1maa/bitcoin:${{ matrix.knots-version }} cache-to: type=inline context: . - file: v25.1.knots20231115/Dockerfile + file: ${{ matrix.knots-version }}/Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true - tags: 1maa/bitcoin:v25.1.knots20231115 + tags: 1maa/bitcoin:${{ matrix.knots-version }} diff --git a/v26.1.knots20240325/Dockerfile b/v26.1.knots20240325/Dockerfile new file mode 100644 index 0000000..5fb1d52 --- /dev/null +++ b/v26.1.knots20240325/Dockerfile @@ -0,0 +1,94 @@ +FROM alpine:3.18 AS builder + +ARG KNOTS_VERSION=26.1.knots20240325 + +WORKDIR /tmp + +ADD https://bitcoinknots.org/files/26.x/${KNOTS_VERSION}/SHA256SUMS . +ADD https://bitcoinknots.org/files/26.x/${KNOTS_VERSION}/SHA256SUMS.asc . +ADD https://bitcoinknots.org/files/26.x/${KNOTS_VERSION}/bitcoin-${KNOTS_VERSION}.tar.gz . + +COPY builder_pubkeys.pem . + +RUN apk add --no-cache \ + coreutils \ + gnupg \ + gnupg-keyboxd \ + && gpg --import builder_pubkeys.pem \ + && gpg --verify SHA256SUMS.asc SHA256SUMS \ + && sha256sum --ignore-missing -c SHA256SUMS + +RUN apk add --no-cache \ + autoconf \ + automake \ + build-base \ + curl \ + git \ + libtool \ + linux-headers \ + pkgconf + +RUN tar zxf bitcoin-${KNOTS_VERSION}.tar.gz + +RUN ./bitcoin-${KNOTS_VERSION}/autogen.sh + +RUN make -C bitcoin-${KNOTS_VERSION}/depends -j$(nproc) NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_USDT=1 + +ENV CFLAGS="-O2 --static -static -fPIC" +ENV CXXFLAGS="-O2 --static -static -fPIC" +ENV LDFLAGS="-s -static-libgcc -static-libstdc++" + +RUN ARCH_TRIPLET=$(find /tmp/bitcoin-${KNOTS_VERSION}/depends | grep -E "config\.site$" | cut -d/ -f 5) \ + && mkdir build \ + && cd build \ + && ../bitcoin-${KNOTS_VERSION}/configure \ + CONFIG_SITE=/tmp/bitcoin-${KNOTS_VERSION}/depends/${ARCH_TRIPLET}/share/config.site \ + --disable-bench \ + --disable-fuzz-binary \ + --disable-gui-tests \ + --disable-maintainer-mode \ + --disable-man \ + --disable-tests \ + --enable-lto \ + --with-daemon=yes \ + --with-gui=no \ + --with-libmultiprocess=no \ + --with-libs=no \ + --with-miniupnpc=no \ + --with-mpgen=no \ + --with-natpmp=no \ + --with-qrencode=no \ + --with-utils=yes + +RUN make -C ./build -j$(nproc) + +RUN make -C ./build install + + +FROM alpine:3.19 + +COPY --from=builder /usr/local/bin/* /usr/local/bin/ + +COPY bitcoin.conf /etc/bitcoin/bitcoin.conf + +RUN adduser -D bitcoin + +USER bitcoin + +RUN mkdir /home/bitcoin/.bitcoin + +VOLUME /home/bitcoin/.bitcoin + +# REST interface +EXPOSE 8080 + +# P2P network (mainnet, testnet & regnet respectively) +EXPOSE 8333 18333 18444 + +# RPC interface (mainnet, testnet & regnet respectively) +EXPOSE 8332 18332 18443 + +# ZMQ ports (for transactions & blocks respectively) +EXPOSE 28332 28333 + +CMD ["/usr/local/bin/bitcoind", "-conf=/etc/bitcoin/bitcoin.conf"]