Skip to content

Commit e6d102a

Browse files
committed
Added support for multiple architectures
1 parent d5b67cb commit e6d102a

File tree

5 files changed

+67
-60
lines changed

5 files changed

+67
-60
lines changed

.circleci/config.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
version: 2
22

3-
jobs:
4-
build:
5-
machine: true
3+
jobs:
4+
build:
5+
machine:
6+
image: "ubuntu-1604:201903-01"
67
steps:
78
- checkout
8-
- run: echo 'export DOCKER_TAG=${DOCKER_USERNAME}/bitcoind:${CIRCLE_BRANCH}' >> $BASH_ENV
9-
- run: docker info
10-
- run: docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=$CIRCLE_SHA1 . -t ${DOCKER_TAG}
11-
- run: docker run --rm ${DOCKER_TAG} -version
12-
nightly:
13-
docker:
14-
- image: circleci/node:10.0-browsers
15-
steps:
16-
- checkout
17-
- run:
18-
name: Trigger docker nightly remotely
19-
command: |
20-
curl -H 'Content-Type: application/json' \
21-
--data '{"source_type": "Branch", "source_name": "nightly"}' \
22-
-X POST ${DOCKERHUB_TRIGGER}
9+
- run: echo 'export DOCKER_TAG=${DOCKER_USERNAME}/bitcoind:${CIRCLE_BRANCH}${CIRCLE_TAG}' >> $BASH_ENV
10+
11+
- run: docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
12+
- run: docker run --name=buildcontainer --privileged -d legacycode/bitcoind:builder
13+
- run: docker exec buildcontainer docker buildx create --name worker
14+
- run: docker exec buildcontainer docker buildx use worker
15+
- run: docker exec buildcontainer docker buildx inspect --bootstrap
16+
- run: docker exec buildcontainer docker buildx ls
17+
- run: docker exec buildcontainer docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
18+
- run: docker cp Dockerfile buildcontainer:/
19+
20+
- run: |
21+
docker exec buildcontainer docker buildx build \
22+
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v7 \
23+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
24+
--build-arg VCS_REF=$CIRCLE_SHA1 . -t ${DOCKER_TAG} --push
2325
24-
workflows:
26+
workflows:
2527
version: 2
26-
commit:
27-
jobs:
28+
tagged:
29+
jobs:
30+
- build:
31+
filters:
32+
branches:
33+
ignore: /.*/
34+
tags:
35+
only: /^v.*/
36+
untagged:
37+
jobs:
2838
- build
29-
nightly:
30-
jobs:
31-
- nightly
32-
triggers:
33-
- schedule:
34-
cron: "0 2 * * *"
35-
filters:
36-
branches:
37-
only:
38-
- nightly

Dockerfile

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
1-
ARG BITCOIND_VERSION=v0.19.0.1
1+
ARG BITCOIND_VERSION=0.19.0.1
22

3-
FROM alpine:3.10 AS builder
3+
FROM alpine:3.11 AS builder
44

55
ARG BITCOIND_VERSION
66

7-
# Install dependencies and build the binaries.
8-
RUN apk add --no-cache --update alpine-sdk \
9-
autoconf \
10-
automake \
11-
boost-dev \
12-
git \
13-
libtool \
14-
libevent-dev \
15-
openssl-dev \
16-
zeromq-dev
17-
187
WORKDIR /bitcoin
198

20-
RUN git clone https://github.com/bitcoin/bitcoin.git --branch=$BITCOIND_VERSION --depth=1 /bitcoin \
21-
&& ./autogen.sh \
22-
&& ./configure --disable-wallet \
23-
&& make -j4 \
24-
&& make install
9+
RUN set -eux; \
10+
apkArch="$(apk --print-arch)"; \
11+
\
12+
case "$apkArch" in \
13+
x86) \
14+
url=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-i686-pc-linux-gnu.tar.gz ;; \
15+
x86_64) \
16+
url=https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz ;; \
17+
armv7) \
18+
url=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-arm-linux-gnueabihf.tar.gz ;; \
19+
aarch64) \
20+
url=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-aarch64-linux-gnu.tar.gz ;; \
21+
*) \
22+
echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
23+
esac; \
24+
\
25+
wget -q -O- $url |tar xz -C /bitcoin --strip-components=1
2526

2627

2728
# Start a new, final image.
28-
FROM alpine:3.10 AS final
29+
FROM alpine:3.11 AS final
2930

3031
ARG BUILD_DATE
3132
ARG VCS_REF
@@ -47,7 +48,7 @@ RUN apk add --no-cache --update \
4748
boost \
4849
libevent \
4950
openssl \
50-
libzmq
51+
libzmq
5152

5253
# Add user and group for bitcoin process.
5354
RUN addgroup -S bitcoin \
@@ -62,7 +63,7 @@ USER bitcoin
6263
VOLUME ["/home/bitcoin/.bitcoin"]
6364

6465
# Copy the binaries from the builder image.
65-
COPY --from=builder /usr/local/bin/bitcoind /usr/local/bin/bitcoind
66+
COPY --from=builder /bitcoin/bin/bitcoind /usr/local/bin/bitcoind
6667

6768
# Expose btcd ports (p2p, rpc).
6869
EXPOSE 8333 8332

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bitcoind Docker Image
22

3-
![MicroBadger Size](https://img.shields.io/microbadger/image-size/leacycode/bitcoind) ![MicroBadger Layers](https://img.shields.io/microbadger/layers/legacycode/bitcoind) ![Docker Pulls](https://img.shields.io/docker/pulls/legacycode/bitcoind) ![Docker Stars](https://img.shields.io/docker/stars/legacycode/bitcoind) ![Codacy grade](https://img.shields.io/codacy/grade/109e2de909e645aebaa73d8b099c72b9) ![CircleCI](https://img.shields.io/circleci/build/github/legacycode/bitcoind-docker)
3+
![MicroBadger Layers](https://img.shields.io/microbadger/layers/legacycode/bitcoind) ![Docker Pulls](https://img.shields.io/docker/pulls/legacycode/bitcoind) ![Docker Stars](https://img.shields.io/docker/stars/legacycode/bitcoind) ![Codacy grade](https://img.shields.io/codacy/grade/109e2de909e645aebaa73d8b099c72b9) ![CircleCI](https://img.shields.io/circleci/build/github/legacycode/bitcoind-docker)
44

55
## Introduction
66

@@ -9,10 +9,21 @@ The Docker source file of this image is located at [Dockerfile][1].
99

1010
This documentation focus on running Docker container with _docker-compose.yml_ files. These files are better to read and you can use them as a template. For more information about Docker and Docker compose visit the official [Docker documentation][2].
1111

12-
## Supported tags and respective Dockerfile links
12+
## Supported tags and architectures
13+
14+
This bitcoind images supports following tags for e.g. Linux, Raspberry, Pine64 etc.:
1315

1416
- [`latest`](https://github.com/legacycode/bitcoind-docker/blob/latest/Dockerfile) [`v0.19.0.1`](https://github.com/legacycode/bitcoind-docker/blob/v0.19.0.1/Dockerfile) [`v0.19.0`](https://github.com/legacycode/bitcoind-docker/blob/v0.19.0/Dockerfile) [`v0.18.1`](https://github.com/legacycode/bitcoind-docker/blob/v0.18.1/Dockerfile) - stable bitcoind builds
15-
- [`nightly`](https://github.com/legacycode/bitcoind-docker/blob/nightly/Dockerfile) - nightly bincoind builds (do not use in production)
17+
18+
This images supports following architectures [(more info)](8):
19+
20+
- `amd64` - for most desktop processors
21+
22+
- `arm7v` - for 32-Bit ARM images like Raspbian (Raspberry 1, 2, 3 and 4)
23+
24+
- `arm64` - for 64-Bit ARM images like armbian
25+
26+
- `386` - for legacy desktop processors
1627

1728
## Starting your bitcoind node
1829

hooks/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

hooks/build

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)