Browse Source

Automated builds (#13)

master
Damian Mee 5 years ago
committed by GitHub
parent
commit
938426bc71
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      .github/workflows/dockerarm.yml
  2. 9
      .github/workflows/dockerimage.yml
  3. 165
      .github/workflows/on-tag.yml
  4. 68
      .github/workflows/test.yml
  5. 82
      .travis.yml
  6. 13
      .travis/before-script.sh
  7. 24
      .travis/build-amd64.sh
  8. 26
      .travis/build-arm.sh
  9. 78
      .travis/docker-manifest.sh
  10. 23
      .travis/pull-all.sh
  11. 140
      0.16/Dockerfile
  12. 150
      0.17/Dockerfile
  13. 206
      0.18/Dockerfile
  14. 136
      0.18/Dockerfile.bak
  15. 62
      0.18/binary/Dockerfile
  16. 133
      0.18/source-native/Dockerfile
  17. 132
      0.18/source/Dockerfile
  18. 4
      prepare.sh

11
.github/workflows/dockerarm.yml

@ -1,11 +0,0 @@
name: Build bitcoind on arm
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Register self-compiled qemu
run: docker run --rm --privileged meedamian/simple-qemu-test:minimal --reset -p yes
- name: Build Docker image
run: docker build 0.18/ -f 0.18/source/Dockerfile

9
.github/workflows/dockerimage.yml

@ -1,9 +0,0 @@
name: Build bitcoind on amd64
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Docker image
run: docker build 0.18/ -f 0.18/source-native/Dockerfile

165
.github/workflows/on-tag.yml

@ -0,0 +1,165 @@
name: Build & deploy Bitcoind
on:
push:
tags:
- '*'
jobs:
build:
name: Build Bitcoind
runs-on: ubuntu-18.04
# NOTE: qemu v3.1.1 used instead of currently newest v4.1.0, because v4 is **much** slower for aarch64, see:
# https://github.com/meeDamian/docker-berkeleydb/commit/9e87d11314c2522726497f0c6059e61a31298e7f/checks
env:
QEMU_VERSION: v3.1.1
DOCKER_BUILDKIT: 1
strategy:
matrix:
arch:
- arm32v7
- arm64
- amd64
steps:
- uses: actions/checkout@v1.0.0
- name: Setup environment
run: |
VERSION="$(echo "${GITHUB_REF}" | awk -F/ '{print $NF}' | tr -d v)"
echo ::set-env name=VERSION::"${VERSION}"
echo ::set-env name=DIR::"$(echo "${VERSION}" | cut -d. -f-2)"
- name: Register self-compiled qemu
if: matrix.arch != 'amd64'
run: docker run --rm --privileged "meedamian/simple-qemu:${QEMU_VERSION}-${{matrix.arch}}" -p yes
# Alter `Dockerfile` to reference used architecture/image combos explicitly. Places changed are:
# * all `FROM` statements (ex. `FROM alpine…` -> `FROM arm64v8/alpine…`)
# * BerkeleyDB `COPY` statement (`COPY --from=lncm/berkeleydb:db-4.8.30.NC` gets suffixed with ex. `-arm64`)
# `sed` `--expression`s change it in the following way:
# 1st: Matches all occurrences of `FROM alpine`, and injects arch prefix before `alpine`, ex: `arm64v8/alpine`
# 2nd: Matches BDB version, and appends "-${{matrix.arch}}" to it (note that `&` represents match).
- name: Change Dockerfile to use arch-specific base images
if: matrix.arch != 'amd64'
run: |
CPU="${{matrix.arch}}"
if [[ "${CPU}" == "arm64" ]]; then
CPU="arm64v8"
fi
sed -i ${DIR}/Dockerfile \
-e "s|^FROM alpine|FROM $CPU/alpine|g" \
-e "s|db-4.8.30.NC|&-${{matrix.arch}}|g"
- name: Build Bitcoind
run: >
docker build ${DIR}/
--build-arg "VERSION=${VERSION}"
--tag bitcoind
- name: Print OS info
run: docker run --rm --entrypoint=uname bitcoind -a
- name: Print Bitcoind version
run: docker run --rm bitcoind --version
- name: Save built image into a .tgz file
run: |
mkdir -p images/
docker tag bitcoind "bitcoind:${{matrix.arch}}"
docker save "bitcoind:${{matrix.arch}}" | gzip > "images/bitcoind-${{matrix.arch}}.tgz"
- name: Print sha256sum of built image
run: sha256sum images/*
- name: Upload built image
uses: actions/upload-artifact@v1.0.0
with:
name: images
path: images/
docker-hub-push:
name: Tag & deploy to Docker Hub. Only after successful build and on a git-tag push
runs-on: ubuntu-18.04
needs: build
steps:
- uses: actions/checkout@v1.0.0
- name: Setup environment
run: |
echo ::set-env name=DOCKER_USER::"${GITHUB_ACTOR,,}"
echo ::set-env name=SLUG::"$(echo ${GITHUB_REPOSITORY,,} | sed 's/docker-//')"
echo ::set-env name=VERSION::"$(echo "${GITHUB_REF}" | awk -F/ '{print $NF}')"
- name: Enable manifests
run: |
mkdir -p ~/.docker
echo '{ "experimental": "enabled" }' > ~/.docker/config.json
sudo systemctl restart docker
docker version
- name: Login to Docker Hub
run: |
echo "Logging in as ${DOCKER_USER}…"
echo "${{secrets.DOCKER_TOKEN}}" | docker login -u="${DOCKER_USER}" --password-stdin
- name: Download all build artifacts
uses: actions/download-artifact@v1.0.0
with:
name: images
- name: Print sha256sum of all images
run: sha256sum images/*
- name: Load images locally
run: ls images/ | xargs -I % docker load -i "images/%"
# No short tags. IMO bitcoind version should always be specified exactly, and explicitly.
- name: Version-tag all images
run: docker images bitcoind --format "{{.Tag}}" | xargs -I % docker tag "bitcoind:%" "${SLUG}:${VERSION}-%"
- name: List all tagged images
run: docker images "${SLUG}"
- name: Push all images
run: docker images "${SLUG}" --format "{{.Repository}}:{{.Tag}}" | xargs -I % docker push %
- name: Create manifest
run: >
docker -D manifest create "${SLUG}:${VERSION}" \
"${SLUG}:${VERSION}-amd64" \
"${SLUG}:${VERSION}-arm64" \
"${SLUG}:${VERSION}-arm32v7"
- name: Annotate arm32v7
run: docker manifest annotate "${SLUG}:${VERSION}" "${SLUG}:${VERSION}-arm32v7" --os linux --arch arm --variant v7
- name: Annotate arm64v8
run: docker manifest annotate "${SLUG}:${VERSION}" "${SLUG}:${VERSION}-arm64" --os linux --arch arm64 --variant v8
- name: Push manifest
run: docker manifest push "${SLUG}:${VERSION}"
- name: Sync README.md and Description to Docker Hub
uses: meeDamian/sync-readme@v1.0.5
with:
pass: ${{secrets.DOCKER_TOKEN}}
slug: lncm/bitcoind
description: true
- name: Upload images to Github Release
uses: meeDamian/github-release@v1.0.0
with:
token: ${{secrets.GITHUB_TOKEN}}
gzip: false
files: images/*

68
.github/workflows/test.yml

@ -0,0 +1,68 @@
name: Build bitcoind on master push
on:
push:
branches:
- master
jobs:
build:
name: Build Bitcoind
runs-on: ubuntu-18.04
# NOTE: qemu v3.1.1 used instead of currently newest v4.1.0, because v4 is **much** slower for aarch64, see:
# https://github.com/meeDamian/docker-berkeleydb/commit/9e87d11314c2522726497f0c6059e61a31298e7f/checks
env:
QEMU_VERSION: v3.1.1
DOCKER_BUILDKIT: 1
strategy:
fail-fast: false
matrix:
subver:
- '0.16'
- '0.17'
- '0.18'
arch:
- arm32v7
- arm64
- amd64
steps:
- uses: actions/checkout@v1.0.0
- name: Register self-compiled qemu
if: matrix.arch != 'amd64'
run: docker run --rm --privileged meedamian/simple-qemu:${QEMU_VERSION}-${{matrix.arch}} -p yes
# Alter `Dockerfile` to reference used architecture/image combos explicitly. Places changed are:
# * all `FROM` statements (ex. `FROM alpine…` -> `FROM arm64v8/alpine…`)
# * BerkeleyDB `COPY` statement (`COPY --from=lncm/berkeleydb:db-4.8.30.NC` gets suffixed with ex. `-arm64`)
# `sed` `--expression`s change it in the following way:
# 1st: Matches all occurrences of `FROM alpine`, and injects arch prefix before `alpine`, ex: `arm64v8/alpine`
# 2nd: Matches BDB version, and appends "-${{matrix.arch}}" to it (note that `&` represents match).
- name: Change Dockerfile to use arch-specific base images
if: matrix.arch != 'amd64'
run: |
CPU=${{matrix.arch}}
if [[ "${CPU}" == "arm64" ]]; then
CPU="arm64v8"
fi
sed -i ${{matrix.subver}}/Dockerfile \
-e "s|^FROM alpine|FROM $CPU/alpine|g" \
-e "s|db-4.8.30.NC|&-${{matrix.arch}}|g"
# NOTE: Don't build 32-bit version of 0.17.1, as it's broken & non-essential:
# https://github.com/bitcoin/bitcoin/pull/15950
- name: Build Bitcoind
if: matrix.subver != '0.17' || matrix.arch != 'arm32v7'
run: docker build -t bitcoind ${{matrix.subver}}/
- name: Print Bitcoind version
if: matrix.subver != '0.17' || matrix.arch != 'arm32v7'
run: |
docker run --rm --entrypoint=uname bitcoind -a
docker run --rm bitcoind --version

82
.travis.yml

@ -1,82 +0,0 @@
sudo: required
dist: xenial
services:
- docker
language: minimal
# SLUG - converts Gihub slug (`lncm/docker-bitcoind`) to Docker slug (`lncm/bitcoind`)
# VER - if TAG is being build, VER contains only MAJOR and MINOR parts of the version (ex. `0.18.0` -> `0.18`)
# DIR - if BRANCH is being built, use DIR with the highest version number
# PREFIX - sets Dockerfile prefix. Be it based on `git tag`, or highest-version DIR name
env:
global:
- SLUG="${TRAVIS_REPO_SLUG/docker-/}"
- VER=$(echo ${TRAVIS_TAG} | cut -d. -f1,2)
- DIR=$(ls -vd */ | grep '^[0-9]' | tail -n 1 | tr -d /)
- PREFIX="${VER:-$DIR}"
stages:
- build
- name: deploy
if: tag IS present
jobs:
include:
# - stage: build
# name: "Build Docker image from SOURCE for amd64"
# env: ARCH=amd64 FROM=source
# - name: "Build Docker image from BINARY for amd64"
# env: ARCH=amd64 FROM=binary
- stage: build
name: "Build Docker image from SOURCE for arm"
env: ARCH=arm FROM=source
- name: "See how fast building toolchain works on Travis"
script: docker build 0.18/
# - name: "Build Docker image from BINARY for arm"
# env: ARCH=arm FROM=binary
- stage: deploy
name: "Aggregate Docker images under one manifest"
script: ./.travis/docker-manifest.sh
- name: "Upload Docker containers to Github Releases"
deploy:
skip_cleanup: true
provider: releases
api_key:
secure: H7PazuFTFL/sTAf6DH47wB81rfB6AXsPdiDBTmMvPc6+P7zr3O+1g6T1c93sUq5wrVqUnD/XKLmPXDTWhiQVoLkdDPzM9fdd2JTzgbzfXTDtg7gi/mNuZOgftoKwRYiLhNnWR/hKmtLcXFYYzKVRt1BUGShv722y4lVl/GPolzRLGyO1+5f0dC48VBjYmDxInUkM32bFkVSlQ2ro+OndecRhn/Pd8oOPPOwwM+/4iplsbBe4pRJ4kHMjgxdJRnV3kb+jUuA0Q+4U5XXPDGLw4BDh6/wZZ4IUgIAubNam32B7lql9t733ksuPtWA40rkwEFmfQyGGU1QEzb4gHUOcKpKfm43s8THjU85EnSSuyv3NWmZL4/wtmnJL/SpW6azdnSjycJUlddXX1MvsMvdnrZrSSU4WWCHtxOxgm1Figv/QAtn48NMwhmpCya2HYBZKlpqqPYj0j3pk9+ifJANF9DzMJ/xBXuPBW7M3WFCDlnGIqXXRAKbk6mEkecBk8JH0Qn/gGVm+pTV9Rcm2wKcQwrSyBkC//nJ6CXQXZ9OSW8m7NqkCRfIjSQ9g/caZgkxNEKyNYWssLB8UJ8CKyrkRH0jjfXJ1bhwbyw3Opg6b6rafPqQHwGb9Dm8Z8QlnhyafVEcry9kRVax6NWMNZkCP19U0t0Fhs0OFR2Ex7FbZ+Cw=
file_glob: true
file: images/*.tgz
on:
repo: lncm/docker-bitcoind
tags: true
before_script: ./.travis/before-script.sh
script:
- >
if [[ "${ARCH}" = "amd64" ]]; then
./.travis/build-amd64.sh
elif [[ "${ARCH}" = "arm" ]]; then
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.10.0/alpine-chroot-install \
&& echo 'dcceb34aa63767579f533a7f2e733c4d662b0d1b alpine-chroot-install' | sha1sum -c \
|| exit 1
chmod +x alpine-chroot-install
sudo ./alpine-chroot-install -a armhf -b v3.9
/alpine/enter-chroot apk add bash
/alpine/enter-chroot ~/.travis/build-arm.sh || true
/alpine/enter-chroot ./.travis/build-arm.sh || true
elif [[ ! -z "${ARCH}" ]]; then
./.travis/pull-all.sh
fi

13
.travis/before-script.sh

@ -1,13 +0,0 @@
#!/bin/bash
set -e
#if [[ ! -z "${FROM}" ]]; then
# PREFIX="${PREFIX}/${FROM}"
#fi
## Magic `sed` command that replaces the last occurrence of `FROM alpine` with `FROM arm32v7/alpine`
## if base architecture of the final stage needs changing. Don't ask me about the "3".
#if [[ "${ARCH}" = "arm" ]]; then
# sed -i '3,\|^FROM alpine| s|FROM alpine|FROM arm32v7/alpine|' ${PREFIX}/Dockerfile
# echo "${PREFIX}/Dockerfile modified: Final stage image, base CPU architecture changed to: arm32v7"
#fi

24
.travis/build-amd64.sh

@ -1,24 +0,0 @@
#!/bin/bash
set -e
TAG="${SLUG}:${TRAVIS_TAG:-$TRAVIS_BRANCH}-${FROM}-linux-${ARCH}"
echo "Building ${TAG} with ${PREFIX}/Dockerfile…"
if [[ "${FROM}" = "binary" ]]; then
docker build --no-cache --build-arg "arch=x86_64" -t ${TAG} ${PREFIX}/${FROM}/
else
docker build --no-cache -t ${TAG} ${PREFIX}/${FROM}/
fi
# Push image, if tag was specified
if [[ -n "${TRAVIS_TAG}" ]]; then
echo "${DOCKER_PASS}" | docker login -u="${DOCKER_USER}" --password-stdin
docker push "${TAG}"
fi

26
.travis/build-arm.sh

@ -1,26 +0,0 @@
#!/bin/bash
set -e
apk add docker
TAG="${SLUG}:${TRAVIS_TAG:-$TRAVIS_BRANCH}-${FROM}-linux-${ARCH}"
echo "Building ${TAG} with ${PREFIX}/Dockerfile…"
if [[ "${FROM}" = "binary" ]]; then
docker build --no-cache --build-arg "arch=${ARCH}" -t ${TAG} ${PREFIX}/${FROM}/
else
docker build --no-cache -t ${TAG} ${PREFIX}/${FROM}/
fi
# Push image, if tag was specified
if [[ -n "${TRAVIS_TAG}" ]]; then
echo "${DOCKER_PASS}" | docker login -u="${DOCKER_USER}" --password-stdin
docker push "${TAG}"
fi

78
.travis/docker-manifest.sh

@ -1,78 +0,0 @@
#!/bin/bash
set -e
# make sure Docker's config folder exists
mkdir -p ~/.docker
# Putting experimental:true to config enables manifest options
echo '{ "experimental": "enabled" }' > ~/.docker/config.json
# put above config into effect
sudo systemctl restart docker
echo "${DOCKER_PASS}" | docker login -u="${DOCKER_USER}" --password-stdin
# print this to verify manifest options are now available
docker version
# Example: lncm/bitcoind:0.18.0
IMAGE_VERSIONED="${SLUG}:${TRAVIS_TAG}"
IMAGE_AMD64_SRC="${IMAGE_VERSIONED}-source-linux-amd64"
#IMAGE_ARM7_SRC="${IMAGE_VERSIONED}-source-linux-armv7"
docker pull "${IMAGE_AMD64_SRC}"
#docker pull "${IMAGE_ARM7_SRC}"
echo "Pushing manifest ${IMAGE_VERSIONED}"
docker -D manifest create "${IMAGE_VERSIONED}" "${IMAGE_AMD64_SRC}" #"${IMAGE_ARM7_SRC}"
#docker manifest annotate "${IMAGE_VERSIONED}" "${IMAGE_ARM7_SRC}" --os linux --arch arm --variant v7
docker manifest push "${IMAGE_VERSIONED}"
# example: lncm/bitcoind:0.18
IMAGE_MINOR_VER="${SLUG}:${VER}"
echo "Pushing manifest ${IMAGE_MINOR_VER}"
docker -D manifest create "${IMAGE_MINOR_VER}" "${IMAGE_AMD64_SRC}" #"${IMAGE_ARM7_SRC}"
#docker manifest annotate "${IMAGE_MINOR_VER}" "${IMAGE_ARM7_SRC}" --os linux --arch arm --variant v7
docker manifest push "${IMAGE_MINOR_VER}"
#example: lncm/bitcoind:latest
IMAGE_LATEST="${SLUG}:latest"
echo "Pushing manifest ${IMAGE_LATEST}"
docker -D manifest create "${IMAGE_LATEST}" "${IMAGE_AMD64_SRC}" #"${IMAGE_ARM7_SRC}"
#docker manifest annotate "${IMAGE_LATEST}" "${IMAGE_ARM7_SRC}" --os linux --arch arm --variant v7
docker manifest push "${IMAGE_LATEST}"
# Example: lncm/bitcoind:0.18.0-binary
IMAGE_VERSIONED="${SLUG}:${TRAVIS_TAG}-binary"
IMAGE_AMD64_BIN="${IMAGE_VERSIONED}-binary-linux-amd64"
#IMAGE_ARM7_BIN="${IMAGE_VERSIONED}-binary-linux-armv7"
docker pull "${IMAGE_AMD64_BIN}"
#docker pull "${IMAGE_ARM7_BIN}"
echo "Pushing manifest ${IMAGE_VERSIONED}"
docker -D manifest create "${IMAGE_VERSIONED}" "${IMAGE_AMD64_BIN}" #"${IMAGE_ARM7_BIN}"
#docker manifest annotate "${IMAGE_VERSIONED}" "${IMAGE_ARM7_BIN}" --os linux --arch arm --variant v7
docker manifest push "${IMAGE_VERSIONED}"
# example: lncm/bitcoind:0.18-binary
IMAGE_MINOR_VER="${SLUG}:${VER}-binary"
echo "Pushing manifest ${IMAGE_MINOR_VER}"
docker -D manifest create "${IMAGE_MINOR_VER}" "${IMAGE_AMD64_BIN}" #"${IMAGE_ARM7_BIN}"
#docker manifest annotate "${IMAGE_MINOR_BIN}" "${IMAGE_ARM7_BIN}" --os linux --arch arm --variant v7
docker manifest push "${IMAGE_MINOR_VER}"
#example: lncm/bitcoind:binary
IMAGE_BINARY="${SLUG}:binary"
echo "Pushing manifest ${IMAGE_BINARY}"
docker -D manifest create "${IMAGE_BINARY}" "${IMAGE_AMD64_BIN}" #"${IMAGE_ARM7_BIN}"
#docker manifest annotate "${IMAGE_BINARY}" "${IMAGE_ARM7_BIN}" --os linux --arch arm --variant v7
docker manifest push "${IMAGE_BINARY}"

23
.travis/pull-all.sh

@ -1,23 +0,0 @@
#!/bin/bash
set -e
echo "Saving images…"
LATEST_AMD64_SRC="${SLUG}:${TRAVIS_TAG}-source-linux-amd64"
LATEST_AMD64_BIN="${SLUG}:${TRAVIS_TAG}-binary-linux-amd64"
#LATEST_ARM7_SRC="${SLUG}:${TRAVIS_TAG}-source-linux-armv7"
#LATEST_ARM7_BIN="${SLUG}:${TRAVIS_TAG}-binary-linux-armv7"
mkdir images
docker pull ${LATEST_AMD64_SRC}
docker save ${LATEST_AMD64_SRC} | gzip > "images/${SLUG/\//-}-${TRAVIS_TAG}-source-linux-amd64.tgz"
docker pull ${LATEST_AMD64_BIN}
docker save ${LATEST_AMD64_BIN} | gzip > "images/${SLUG/\//-}-${TRAVIS_TAG}-binary-linux-amd64.tgz"
#docker pull ${LATEST_ARM7_SRC}
#docker save ${LATEST_ARM7_SRC} | gzip > "images/${SLUG/\//-}-${TRAVIS_TAG}-source-linux-armv7.tgz"
#docker pull ${LATEST_ARM7_BIN}
#docker save ${LATEST_ARM7_BIN} | gzip > "images/${SLUG/\//-}-${TRAVIS_TAG}-binary-linux-armv7.tgz"

140
0.16/Dockerfile

@ -0,0 +1,140 @@
FROM alpine:3.10 AS bitcoin-core
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories && \
apk add --no-cache \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
protobuf-dev \
zeromq-dev
# Fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt/ /opt/
ENV KEY 01EA5486DE18A882D4C2684590C8019E36C2E964
# Try to fetch key from keyservers listed below. On first success terminate with `exit 0`. If loop is not interrupted,
# it means all attempts failed, and `exit 1` is called.
RUN for SRV in hkp://p80.pool.sks-keyservers.net:80 ha.pool.sks-keyservers.net keyserver.pgp.com pgp.mit.edu; do \
timeout 9s gpg --keyserver "${SRV}" --recv-keys "${KEY}" >/dev/null 2<&1 && \
{ echo "OK: ${SRV}" && exit 0; } || \
{ echo "ERR: ${SRV} fail=$?"; } ; \
done && exit 1
RUN gpg --list-keys
ARG VERSION=0.16.3
ENV BITCOIN_VERSION=${VERSION}
RUN echo "Building Bitcoin version: ${BITCOIN_VERSION}"
# Download checksums
RUN wget "https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc"
# Download source code (intentionally different website than checksums)
RUN wget "https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz"
# Verify that hashes are signed with the previously imported key
RUN gpg --verify SHA256SUMS.asc
# Verify that downloaded source-code archive has exactly the hash that's provided
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
# Extract
RUN tar -xzf "bitcoin-${BITCOIN_VERSION}.tar.gz" && \
rm -f "bitcoin-${BITCOIN_VERSION}.tar.gz"
# Change to the extracted directory
WORKDIR /bitcoin-${BITCOIN_VERSION}
# ???
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
# ???
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
# ???
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
ENV BITCOIN_PREFIX="/opt/bitcoin-${BITCOIN_VERSION}"
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L/opt/db4/lib/ CPPFLAGS=-I/opt/db4/include/ \
--prefix="${BITCOIN_PREFIX}" \
--mandir=/usr/share/man \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-daemon
RUN make -j$(($(nproc) + 1)) check
RUN make install
# Already taken advantage of before by `make check`. No need to have them installed, as they're very big (~500 MB).
RUN rm ${BITCOIN_PREFIX}/bin/bench_bitcoin ${BITCOIN_PREFIX}/bin/test_bitcoin
# List installed libs, and binaries pre-strip
RUN ls -lh ${BITCOIN_PREFIX}/bin/ ${BITCOIN_PREFIX}/lib/
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# List installed libs, and binaries after stripping
RUN ls -lh ${BITCOIN_PREFIX}/bin/ ${BITCOIN_PREFIX}/lib/
# Print sha256 hashes of final binaries
RUN find -L ${BITCOIN_PREFIX}/ -type f -exec sha256sum {} \; | sort -t ' ' -k 2
# Build stage for compiled artifacts
FROM alpine:3.10 AS final
LABEL maintainer="Damian Mee (@meeDamian)"
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories
RUN apk add --no-cache \
boost \
boost-program_options \
libevent \
libressl \
libzmq \
su-exec
ARG VERSION=0.16.3
ENV BITCOIN_VERSION=${VERSION}
ENV BITCOIN_PREFIX="/opt/bitcoin-${BITCOIN_VERSION}"
ENV PATH="${BITCOIN_PREFIX}/bin:$PATH"
VOLUME /root/.bitcoin
COPY --from=bitcoin-core /opt /opt
# 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
ENTRYPOINT ["bitcoind"]
CMD ["-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

150
0.17/Dockerfile

@ -1,88 +1,123 @@
# Build stage for Bitcoin Core
FROM alpine:3.9 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt /opt
FROM alpine:3.10 AS bitcoin-core
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add autoconf
RUN apk --no-cache add automake
RUN apk --no-cache add boost-dev
RUN apk --no-cache add build-base
RUN apk --no-cache add chrpath
RUN apk --no-cache add file
RUN apk --no-cache add gnupg
RUN apk --no-cache add libevent-dev
RUN apk --no-cache add libressl
RUN apk --no-cache add libressl-dev
RUN apk --no-cache add libtool
RUN apk --no-cache add linux-headers
RUN apk --no-cache add protobuf-dev
RUN apk --no-cache add zeromq-dev
RUN set -ex \
&& for key in \
90C8019E36C2E964 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done
ENV BITCOIN_VERSION=0.17.1
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories && \
apk add --no-cache \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
protobuf-dev \
zeromq-dev
# Fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt/ /opt/
ENV KEY 01EA5486DE18A882D4C2684590C8019E36C2E964
# Try to fetch key from keyservers listed below. On first success terminate with `exit 0`. If loop is not interrupted,
# it means all attempts failed, and `exit 1` is called.
RUN for SRV in hkp://p80.pool.sks-keyservers.net:80 ha.pool.sks-keyservers.net keyserver.pgp.com pgp.mit.edu; do \
timeout 9s gpg --keyserver "${SRV}" --recv-keys "${KEY}" >/dev/null 2<&1 && \
{ echo "OK: ${SRV}" && exit 0; } || \
{ echo "ERR: ${SRV} fail=$?"; } ; \
done && exit 1
RUN gpg --list-keys
ARG VERSION=0.17.1
ENV BITCOIN_VERSION=${VERSION}
RUN echo "Building Bitcoin version: ${BITCOIN_VERSION}"
# Download checksums
RUN wget "https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc"
# Download source code (intentionally different website than checksums)
RUN wget "https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz"
# Verify that hashes are signed with the previously imported key
RUN gpg --verify SHA256SUMS.asc
# Verify that downloaded source-code archive has exactly the hash that's provided
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
RUN tar -xzf *.tar.gz
# Extract
RUN tar -xzf "bitcoin-${BITCOIN_VERSION}.tar.gz" && \
rm -f "bitcoin-${BITCOIN_VERSION}.tar.gz"
# Change to the extracted directory
WORKDIR /bitcoin-${BITCOIN_VERSION}
# ???
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
# ???
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
# ???
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
ENV BITCOIN_PREFIX="/opt/bitcoin-${BITCOIN_VERSION}"
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
--prefix=${BITCOIN_PREFIX} \
RUN ./configure LDFLAGS=-L/opt/db4/lib/ CPPFLAGS=-I/opt/db4/include/ \
--prefix="${BITCOIN_PREFIX}" \
--mandir=/usr/share/man \
--disable-tests \
--disable-bench \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-daemon
RUN make
RUN make -j$(($(nproc) + 1)) check
RUN make install
# Already taken advantage of before by `make check`. No need to have them installed, as they're very big (~500 MB).
RUN rm ${BITCOIN_PREFIX}/bin/bench_bitcoin ${BITCOIN_PREFIX}/bin/test_bitcoin
# List installed libs, and binaries pre-strip
RUN ls -lh ${BITCOIN_PREFIX}/bin/ ${BITCOIN_PREFIX}/lib/
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# List installed libs, and binaries after stripping
RUN ls -lh ${BITCOIN_PREFIX}/bin/ ${BITCOIN_PREFIX}/lib/
# Print sha256 hashes of final binaries
RUN find -L ${BITCOIN_PREFIX}/ -type f -exec sha256sum {} \; | sort -t ' ' -k 2
# Build stage for compiled artifacts
FROM alpine:3.9 AS final
FROM alpine:3.10 AS final
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
LABEL maintainer="Damian Mee (@meeDamian)"
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add \
boost \
boost-program_options \
libevent \
libressl \
libzmq \
su-exec
ENV BITCOIN_VERSION=0.17.1
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories
RUN apk add --no-cache \
boost \
boost-program_options \
libevent \
libressl \
libzmq \
su-exec
ARG VERSION=0.17.1
ENV BITCOIN_VERSION=${VERSION}
ENV BITCOIN_PREFIX="/opt/bitcoin-${BITCOIN_VERSION}"
ENV PATH="${BITCOIN_PREFIX}/bin:$PATH"
VOLUME /root/.bitcoin
@ -101,4 +136,5 @@ EXPOSE 8332 18332 18443
EXPOSE 28332 28333
ENTRYPOINT ["bitcoind"]
CMD ["bitcoind", "-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]
CMD ["-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

206
0.18/Dockerfile

@ -1,62 +1,146 @@
# Build stage for Bitcoin Core
FROM alpine:3.9 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC-linux-arm /opt /opt
# Replace `http:` repositories with `https:` ones
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN echo 'https://alpine.global.ssl.fastly.net/alpine/edge/testing' >> /etc/apk/repositories
# install packages necessary to build Bitcoind
RUN apk add --no-cache --update \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
crosstool-ng \
curl \
file \
g++ \
gcc \
git \
gnupg \
libevent-dev \
FROM alpine:3.10 AS bitcoin-core
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories && \
apk add --no-cache \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
protobuf-dev \
zeromq-dev
# Fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt/ /opt/
ENV KEY 01EA5486DE18A882D4C2684590C8019E36C2E964
# Try to fetch key from keyservers listed below. On first success terminate with `exit 0`. If loop is not interrupted,
# it means all attempts failed, and `exit 1` is called.
RUN for SRV in hkp://p80.pool.sks-keyservers.net:80 ha.pool.sks-keyservers.net keyserver.pgp.com pgp.mit.edu; do \
timeout 9s gpg --keyserver "${SRV}" --recv-keys "${KEY}" >/dev/null 2<&1 && \
{ echo "OK: ${SRV}" && exit 0; } || \
{ echo "ERR: ${SRV} fail=$?"; } ; \
done && exit 1
RUN gpg --list-keys
ARG VERSION=0.18.1
ENV BITCOIN_VERSION=${VERSION}
RUN echo "Building Bitcoin version: ${BITCOIN_VERSION}"
# Download checksums
RUN wget "https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc"
# Download source code (intentionally different website than checksums)
RUN wget "https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz"
# Verify that hashes are signed with the previously imported key
RUN gpg --verify SHA256SUMS.asc
# Verify that downloaded source-code archive has exactly the hash that's provided
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
# Extract
RUN tar -xzf "bitcoin-${BITCOIN_VERSION}.tar.gz" && \
rm -f "bitcoin-${BITCOIN_VERSION}.tar.gz"
# Change to the extracted directory
WORKDIR /bitcoin-${BITCOIN_VERSION}
# Disable emoji test that fails on Alpine for unrelated reasons: missing locale. Not important.
# https://github.com/bitcoin/bitcoin/issues/14948
COPY skip-fs-test-of-utf8.patch .
RUN patch -p0 < skip-fs-test-of-utf8.patch
# ???
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
# ???
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
# ???
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
ENV BITCOIN_PREFIX="/opt/bitcoin-${BITCOIN_VERSION}"
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L/opt/db4/lib/ CPPFLAGS=-I/opt/db4/include/ \
--prefix="${BITCOIN_PREFIX}" \
--mandir=/usr/share/man \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-daemon
RUN make -j$(($(nproc) + 1)) check
RUN make install
# Already taken advantage of before by `make check`. No need to have them installed, as they're very big (~500 MB).
RUN rm ${BITCOIN_PREFIX}/bin/bench_bitcoin ${BITCOIN_PREFIX}/bin/test_bitcoin
# List installed libs, and binaries pre-strip
RUN ls -lh ${BITCOIN_PREFIX}/bin/ ${BITCOIN_PREFIX}/lib/
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-wallet
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# List installed libs, and binaries after stripping
RUN ls -lh ${BITCOIN_PREFIX}/bin/ ${BITCOIN_PREFIX}/lib/
# Print sha256 hashes of final binaries
RUN find -L ${BITCOIN_PREFIX}/ -type f -exec sha256sum {} \; | sort -t ' ' -k 2
# Build stage for compiled artifacts
FROM alpine:3.10 AS final
LABEL maintainer="Damian Mee (@meeDamian)"
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's|http://dl-cdn.alpinelinux.org|https://alpine.global.ssl.fastly.net|g' /etc/apk/repositories
RUN apk add --no-cache \
boost \
boost-program_options \
libevent \
libressl \
libressl-dev \
libtool \
linux-headers \
make \
protobuf-dev \
tar \
wget \
zeromq-dev
# We are inside Docker container. It's easier to run as root, and no damage can be done anyway… so ¯\_(ツ)_/¯
ENV CT_EXPERIMENTAL=y
ENV CT_ALLOW_BUILD_AS_ROOT=y
ENV CT_ALLOW_BUILD_AS_ROOT_SURE=y
RUN apk add xz patch binutils
RUN ct-ng arm-unknown-linux-musleabi
RUN ct-ng -d build || true
RUN tail -n 200 build.log
# Alpine gotchas:
#
# `apk add --update wget` has to be run.
# Otherwise "wget: unrecognized option: progress=dot:binary" is returned
#
# `apk add --update tor` has to be run.
# Otherwise "tar: invalid tar magic" is returned
#
# `apk add --update patch`
# Otherwise: "/usr/bin/patch: unrecognized option: 0"
#
# Just missing & needs installing: xz strip (part of binutils)
libzmq \
su-exec
ARG VERSION=0.18.1
ENV BITCOIN_VERSION=${VERSION}
ENV BITCOIN_PREFIX="/opt/bitcoin-${BITCOIN_VERSION}"
ENV PATH="${BITCOIN_PREFIX}/bin:$PATH"
VOLUME /root/.bitcoin
COPY --from=bitcoin-core /opt /opt
# 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
ENTRYPOINT ["bitcoind"]
CMD ["-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

136
0.18/Dockerfile.bak

@ -1,136 +0,0 @@
# Build stage for Bitcoin Core
FROM alpine:3.9 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC-linux-arm /opt /opt
# Replace `http:` repositories with `https:` ones
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN echo 'https://alpine.global.ssl.fastly.net/alpine/edge/testing' >> /etc/apk/repositories
# install packages necessary to build Bitcoind
RUN apk add --no-cache --update \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
curl \
file \
# g++ \
# gcc-cross-embedded \
crosstool-ng \
git \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
protobuf-dev \
zeromq-dev
#RUN set -ex \
# && for key in \
# 90C8019E36C2E964 \
# ; do \
# gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
# gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
# gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
# gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
# done
ENV BITCOIN_VERSION=0.18.0
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
RUN git clone -b "v${BITCOIN_VERSION}" https://github.com/bitcoin/bitcoin.git
# Download checksums (intentionally different source than source code)
#RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
# Download source code (intentionally different source than checksums)
#RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
# Verify that hashes are signed with the previously imported key
#RUN gpg --verify SHA256SUMS.asc
# Verify that downloaded source-code archive has exactly the hash that's provided
#RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
# Extract
#RUN tar -xzf *.tar.gz
# Change to the extraced directory
WORKDIR /bitcoin
# -${BITCOIN_VERSION}
# ???
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
# ???
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
# ???
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
--prefix=${BITCOIN_PREFIX} \
--mandir=/usr/share/man \
--disable-tests \
--disable-bench \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-daemon
RUN make
RUN make install
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# Build stage for compiled artifacts
FROM alpine:3.9 AS final
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
# TODO: Eliminating the two RUN lines below is necessary to cross-compile…
# Replace `http:` repositories with `https:` ones
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache --update
add \
boost \
boost-program_options \
libevent \
libressl \
libzmq \
su-exec
ENV BITCOIN_VERSION=0.18.0
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
VOLUME /root/.bitcoin
COPY --from=bitcoin-core /opt /opt
# 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
ENTRYPOINT ["bitcoind"]
CMD ["bitcoind", "-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

62
0.18/binary/Dockerfile

@ -1,62 +0,0 @@
# Build stage for Bitcoin Core
FROM alpine:3.9 AS bitcoin-core
#RUN apk --no-cache add autoconf
#RUN apk --no-cache add automake
#RUN apk --no-cache add boost-dev
#RUN apk --no-cache add build-base
#RUN apk --no-cache add chrpath
#RUN apk --no-cache add file
RUN apk --no-cache add gnupg
#RUN apk --no-cache add libevent-dev
#RUN apk --no-cache add libressl
#RUN apk --no-cache add libressl-dev
#RUN apk --no-cache add libtool
#RUN apk --no-cache add linux-headers
#RUN apk --no-cache add protobuf-dev
#RUN apk --no-cache add zeromq-dev
RUN set -ex \
&& for key in \
90C8019E36C2E964 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done
ENV BITCOIN_VERSION=0.18.0
ARG arch
RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${arch}-linux-gnu.tar.gz
RUN gpg --verify SHA256SUMS.asc
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
RUN tar -xzf *.tar.gz
RUN install -m 0755 -o root -g root -t /usr/local/bin bitcoin-${BITCOIN_VERSION}/bin/*
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
VOLUME /root/.bitcoin
COPY --from=bitcoin-core /opt /opt
# 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
ENTRYPOINT ["bitcoind"]
CMD ["bitcoind", "-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

133
0.18/source-native/Dockerfile

@ -1,133 +0,0 @@
# Build stage for Bitcoin Core
FROM alpine:3.10 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt /opt
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
# install packages necessary to build Bitcoind
RUN apk add --no-cache --update \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
protobuf-dev \
zeromq-dev
RUN set -ex \
&& for key in \
90C8019E36C2E964 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done
ENV BITCOIN_VERSION=0.18.1
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
# Download checksums (intentionally different source than source code)
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
# Download source code (intentionally different source than checksums)
RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
# Verify that hashes are signed with the previously imported key
RUN gpg --verify SHA256SUMS.asc
# Verify that downloaded source-code archive has exactly the hash that's provided
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
# Extract
RUN tar -xzf *.tar.gz
# Change to the extraced directory
WORKDIR /bitcoin-${BITCOIN_VERSION}
# Disable test that fails on Alpine for unrelated reasons: missing locale. Not important.
# https://github.com/bitcoin/bitcoin/issues/14948
COPY skip-fs-test-of-utf8.patch .
RUN patch -p0 < skip-fs-test-of-utf8.patch
# ???
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
# ???
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
# ???
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L$(ls -d /opt/db*)/lib/ CPPFLAGS=-I$(ls -d /opt/db*)/include/ \
--prefix=${BITCOIN_PREFIX} \
--mandir=/usr/share/man \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-daemon
RUN make
RUN make check
RUN make install
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# Build stage for compiled artifacts
FROM alpine:3.10 AS final
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
ENV LC_ALL=C.UTF-8
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache --update \
add \
boost \
boost-program_options \
libevent \
libressl \
libzmq \
su-exec
ENV BITCOIN_VERSION=0.18.1
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
VOLUME /root/.bitcoin
COPY --from=bitcoin-core /opt /opt
# 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
ENTRYPOINT ["bitcoind"]
CMD ["bitcoind", "-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

132
0.18/source/Dockerfile

@ -1,132 +0,0 @@
# Build stage for Bitcoin Core
FROM arm32v7/alpine:3.10 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt /opt
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
# install packages necessary to build Bitcoind
RUN apk add --no-cache --update \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
protobuf-dev \
zeromq-dev
RUN set -ex \
&& for key in \
90C8019E36C2E964 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done
ENV BITCOIN_VERSION=0.18.1
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
# Download checksums (intentionally different source than source code)
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
# Download source code (intentionally different source than checksums)
RUN wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
# Verify that hashes are signed with the previously imported key
RUN gpg --verify SHA256SUMS.asc
# Verify that downloaded source-code archive has exactly the hash that's provided
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
# Extract
RUN tar -xzf *.tar.gz
# Change to the extraced directory
WORKDIR /bitcoin-${BITCOIN_VERSION}
# Disable test that fails on Alpine for unrelated reasons: missing locale. Not important.
# https://github.com/bitcoin/bitcoin/issues/14948
COPY skip-fs-test-of-utf8.patch .
RUN patch -p0 < skip-fs-test-of-utf8.patch
# ???
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
# ???
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
# ???
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L$(ls -d /opt/db*)/lib/ CPPFLAGS=-I$(ls -d /opt/db*)/include/ \
--prefix=${BITCOIN_PREFIX} \
--mandir=/usr/share/man \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-daemon
RUN make
RUN make check
RUN make install
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
# Build stage for compiled artifacts
FROM arm32v7/alpine:3.10 AS final
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
ENV LC_ALL=C.UTF-8
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache --update \
add \
boost \
boost-program_options \
libevent \
libressl \
libzmq \
su-exec
ENV BITCOIN_VERSION=0.18.1
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
VOLUME /root/.bitcoin
COPY --from=bitcoin-core /opt /opt
# 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
ENTRYPOINT ["bitcoind"]
CMD ["bitcoind", "-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

4
prepare.sh

@ -1,4 +0,0 @@
#!/bin/bash
set -e
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Loading…
Cancel
Save