Compare commits
No commits in common. "master" and "support/remove-vulnerable-versions" have entirely different histories.
master
...
support/re
21
.drone.yml
21
.drone.yml
@ -1,21 +0,0 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: default
|
||||
|
||||
metadata:
|
||||
namespace: git
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: docker
|
||||
privileged: true
|
||||
environment:
|
||||
TOKEN:
|
||||
from_secret: gitea
|
||||
commands:
|
||||
- dockerd &
|
||||
- docker login -u kieran -p $TOKEN git.v0l.io
|
||||
- docker buildx build -t git.v0l.io/kieran/bitcoin:latest --push 26/
|
||||
- kill $(cat /var/run/docker.pid)
|
||||
|
135
.github/workflows/build.yaml
vendored
135
.github/workflows/build.yaml
vendored
@ -1,135 +0,0 @@
|
||||
name: build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
version:
|
||||
- '24'
|
||||
- '24/alpine'
|
||||
- '23'
|
||||
- '23/alpine'
|
||||
- '22'
|
||||
- '22/alpine'
|
||||
- '0.21'
|
||||
- '0.21/alpine'
|
||||
- '0.20'
|
||||
- '0.20/alpine'
|
||||
- '0.19'
|
||||
- '0.19/alpine'
|
||||
- '0.18'
|
||||
- '0.18/alpine'
|
||||
- '0.17'
|
||||
- '0.17/alpine'
|
||||
- '0.16'
|
||||
- '0.16/alpine'
|
||||
- '0.13'
|
||||
- '0.13/alpine'
|
||||
- '0.12'
|
||||
- '0.12/alpine'
|
||||
- '0.11'
|
||||
- '0.11/alpine'
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Prepare Docker build
|
||||
id: prepare
|
||||
run: |
|
||||
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
|
||||
|
||||
BITCOIN_VERSION=${{matrix.version}}
|
||||
LATEST_BITCOIN_MAJOR_VERSION=$(find . -type d -maxdepth 1 -not -path '*/\.*' | sort -n | tail -n 1 | cut -c 3-)
|
||||
PLATFORMS="linux/amd64"
|
||||
PUSH=false
|
||||
REPO=ruimarinho/bitcoin-core
|
||||
TAGS=()
|
||||
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
PUSH=true
|
||||
|
||||
if [[ ${BITCOIN_VERSION} == *"alpine"* ]]; then
|
||||
TAGS+=("$REPO:$TAG-alpine")
|
||||
else
|
||||
TAGS+=("$REPO:$TAG")
|
||||
fi
|
||||
|
||||
if [ $(version ${TAG}) -ge $(version "22.0") ]; then
|
||||
TAG_MAJOR_MINOR=$(echo $TAG | cut -c -2)"
|
||||
else
|
||||
TAG_MAJOR_MINOR=$(echo $TAG | cut -c -4)"
|
||||
fi
|
||||
|
||||
if [ $(version ${TAG_MAJOR_MINOR}) -ne $(version ${BITCOIN_VERSION}) ]; then
|
||||
echo "Skipping build of base image $BITCOIN_VERSION/ as ${TAG} is targeted at ${TAG_MAJOR_MINOR}/"
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
TAGS=("$REPO:${BITCOIN_VERSION/\//-}")
|
||||
|
||||
if [ $(version ${BITCOIN_VERSION}) -ge $(version ${LATEST_BITCOIN_MAJOR_VERSION}) ]; then
|
||||
echo "Version $(version ${BITCOIN_VERSION}) is greater than or equal to $(version ${LATEST_BITCOIN_MAJOR_VERSION}), tagging as latest"
|
||||
|
||||
if [[ ${BITCOIN_VERSION} != *"alpine"* ]]; then
|
||||
TAGS+=("$REPO:latest")
|
||||
else
|
||||
TAGS+=("$REPO:alpine")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $GITHUB_REF == "refs/heads/master" ]; then
|
||||
PUSH=true
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${BITCOIN_VERSION} != *"alpine"* ]] && [ $(version ${BITCOIN_VERSION}) -ge $(version "0.19") ]; then
|
||||
PLATFORMS="linux/amd64,linux/arm/v7,linux/arm64"
|
||||
fi
|
||||
|
||||
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
echo ::set-output name=docker_platforms::${PLATFORMS}
|
||||
echo ::set-output name=docker_username::ruimarinho
|
||||
echo ::set-output name=push::${PUSH}
|
||||
echo ::set-output name=tags::${TAGS[@]}
|
||||
echo ::set-output name=build::true
|
||||
|
||||
- if: ${{ steps.prepare.outputs.build }} == 'true'
|
||||
name: Login into Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ruimarinho
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
|
||||
- if: ${{ steps.prepare.outputs.build }} == 'true'
|
||||
name: Build Docker image
|
||||
run: |
|
||||
TAGS=(${{ steps.prepare.outputs.tags }})
|
||||
|
||||
echo "Build date: ${{ steps.prepare.outputs.build_date }}"
|
||||
echo "Docker platform: ${{ steps.prepare.outputs.docker_platforms }}"
|
||||
echo "Push: ${{ steps.prepare.outputs.push }}"
|
||||
echo "Tags: ${{ steps.prepare.outputs.tags }}"
|
||||
|
||||
echo docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
|
||||
--output "type=image,push=${{steps.prepare.outputs.push}}" \
|
||||
--progress=plain \
|
||||
--build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
|
||||
--build-arg "VCS_REF=${GITHUB_SHA::8}" \
|
||||
$(printf "%s" "${TAGS[@]/#/ --tag }" ) \
|
||||
${{ matrix.version }}/
|
||||
|
||||
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
|
||||
--output "type=image,push=${{steps.prepare.outputs.push}}" \
|
||||
--progress=plain \
|
||||
--build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
|
||||
--build-arg "VCS_REF=${GITHUB_SHA::8}" \
|
||||
$(printf "%s" "${TAGS[@]/#/ --tag }" ) \
|
||||
${{ matrix.version }}/
|
24
.travis.yml
Normal file
24
.travis.yml
Normal file
@ -0,0 +1,24 @@
|
||||
after_script:
|
||||
- docker images
|
||||
|
||||
before_script:
|
||||
- cd "$VERSION"
|
||||
- IMAGE="bitcoin-core:${VERSION/\//-}"
|
||||
|
||||
env:
|
||||
- VERSION=0.16
|
||||
- VERSION=0.16/alpine
|
||||
- VERSION=0.13
|
||||
- VERSION=0.13/alpine
|
||||
- VERSION=0.12
|
||||
- VERSION=0.12/alpine
|
||||
- VERSION=0.11
|
||||
- VERSION=0.11/alpine
|
||||
|
||||
language: bash
|
||||
|
||||
script:
|
||||
- docker build -t "$IMAGE" .
|
||||
- docker run "$IMAGE" --version | grep "Bitcoin Core"
|
||||
|
||||
services: docker
|
@ -1,33 +1,37 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
RUN useradd -r bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get install -y curl gnupg \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
&& set -ex \
|
||||
&& for key in \
|
||||
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
|
||||
; 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 GOSU_VERSION=1.10
|
||||
|
||||
RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \
|
||||
&& curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \
|
||||
&& gpg --verify /usr/local/bin/gosu.asc \
|
||||
&& rm /usr/local/bin/gosu.asc \
|
||||
&& chmod +x /usr/local/bin/gosu
|
||||
|
||||
ENV BITCOIN_VERSION=0.11.2
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
RUN curl -SL https://bitcoin.org/laanwj-releases.asc | gpg --import \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-linux64.tar.gz \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
|
@ -32,9 +32,7 @@ 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 ca-certificates
|
||||
RUN apk --no-cache add chrpath
|
||||
RUN apk --no-cache add curl
|
||||
RUN apk --no-cache add file
|
||||
RUN apk --no-cache add gnupg
|
||||
RUN apk --no-cache add libevent-dev
|
||||
@ -48,22 +46,17 @@ RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
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
|
||||
|
||||
# Workaround for Let's Encrypt DST Root CA X3 expiration.
|
||||
RUN sed -i 's#mozilla\/DST_Root_CA_X3.crt#!mozilla\/DST_Root_CA_X3.crt#g' /etc/ca-certificates.conf
|
||||
RUN update-ca-certificates
|
||||
|
||||
ENV BITCOIN_VERSION=0.11.2
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
RUN curl -O https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
|
||||
RUN curl -O https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
|
||||
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 gpg --verify SHA256SUMS.asc
|
||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
@ -99,8 +92,7 @@ LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
RUN adduser -S bitcoin
|
||||
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 \
|
||||
@ -108,7 +100,6 @@ RUN apk --no-cache add \
|
||||
libevent \
|
||||
openssl \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,33 +1,37 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
RUN useradd -r bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get install -y curl gnupg \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
&& set -ex \
|
||||
&& for key in \
|
||||
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
|
||||
; 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 GOSU_VERSION=1.10
|
||||
|
||||
RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \
|
||||
&& curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \
|
||||
&& gpg --verify /usr/local/bin/gosu.asc \
|
||||
&& rm /usr/local/bin/gosu.asc \
|
||||
&& chmod +x /usr/local/bin/gosu
|
||||
|
||||
ENV BITCOIN_VERSION=0.12.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
RUN curl -SL https://bitcoin.org/laanwj-releases.asc | gpg --import \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-linux64.tar.gz \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
@ -43,6 +47,4 @@ EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine:3.9 as berkeleydb
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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
|
||||
@ -23,7 +23,7 @@ RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine:3.9 as bitcoin-core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
@ -46,11 +46,10 @@ RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
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.12.1
|
||||
@ -89,17 +88,13 @@ 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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
FROM alpine
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
RUN adduser -S bitcoin
|
||||
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 \
|
||||
@ -107,7 +102,6 @@ RUN apk --no-cache add \
|
||||
libevent \
|
||||
libressl \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
@ -124,6 +118,4 @@ EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,33 +1,37 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
RUN useradd -r bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get install -y curl gnupg \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
&& set -ex \
|
||||
&& for key in \
|
||||
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
|
||||
; 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 GOSU_VERSION=1.10
|
||||
|
||||
RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \
|
||||
&& curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \
|
||||
&& gpg --verify /usr/local/bin/gosu.asc \
|
||||
&& rm /usr/local/bin/gosu.asc \
|
||||
&& chmod +x /usr/local/bin/gosu
|
||||
|
||||
ENV BITCOIN_VERSION=0.13.2
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
RUN curl -SL https://bitcoin.org/laanwj-releases.asc | gpg --import \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
@ -43,6 +47,4 @@ EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine:3.9 as berkeleydb
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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
|
||||
@ -23,7 +23,7 @@ RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine:3.9 as bitcoin-core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
@ -46,11 +46,10 @@ RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
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.13.2
|
||||
@ -89,17 +88,13 @@ 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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
FROM alpine
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
RUN adduser -S bitcoin
|
||||
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 \
|
||||
@ -107,7 +102,6 @@ RUN apk --no-cache add \
|
||||
libevent \
|
||||
libressl \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
@ -124,6 +118,4 @@ EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,33 +1,37 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
RUN useradd -r bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get install -y curl gnupg \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
&& set -ex \
|
||||
&& for key in \
|
||||
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
|
||||
; 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 GOSU_VERSION=1.10
|
||||
|
||||
RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \
|
||||
&& curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \
|
||||
&& gpg --verify /usr/local/bin/gosu.asc \
|
||||
&& rm /usr/local/bin/gosu.asc \
|
||||
&& chmod +x /usr/local/bin/gosu
|
||||
|
||||
ENV BITCOIN_VERSION=0.16.3
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
RUN curl -SL https://bitcoin.org/laanwj-releases.asc | gpg --import \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
@ -43,6 +47,4 @@ EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine:3.9 as berkeleydb
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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
|
||||
@ -23,7 +23,7 @@ RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine:3.9 as bitcoin-core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
@ -46,11 +46,10 @@ RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
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.16.3
|
||||
@ -87,17 +86,13 @@ 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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
FROM alpine
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
RUN adduser -S bitcoin
|
||||
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 \
|
||||
@ -105,7 +100,6 @@ RUN apk --no-cache add \
|
||||
libevent \
|
||||
libressl \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
@ -122,6 +116,4 @@ EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,16 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
@ -20,10 +10,7 @@ fi
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ENV BITCOIN_VERSION=0.17.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz\$" SHA256SUMS.asc | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,127 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine:3.9 as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine:3.9 as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --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 gpg --verify SHA256SUMS.asc
|
||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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 -j4
|
||||
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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
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 \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=0.17.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,48 +0,0 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ENV BITCOIN_VERSION=0.18.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz\$" SHA256SUMS.asc | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,127 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine:3.9 as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine:3.9 as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --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}
|
||||
|
||||
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 gpg --verify SHA256SUMS.asc
|
||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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 -j4
|
||||
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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
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 \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=0.18.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core Daemon"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,53 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=0.19.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz\$" SHA256SUMS.asc | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,127 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done
|
||||
|
||||
ENV BITCOIN_VERSION=0.19.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 gpg --verify SHA256SUMS.asc
|
||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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 -j4
|
||||
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
|
||||
|
||||
FROM alpine
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
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-chrono \
|
||||
boost-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
libevent \
|
||||
libressl \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=0.19.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,53 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=0.20.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS.asc | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,124 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 libtool
|
||||
RUN apk --no-cache add linux-headers
|
||||
RUN apk --no-cache add zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done
|
||||
|
||||
ENV BITCOIN_VERSION=0.20.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 gpg --verify SHA256SUMS.asc
|
||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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 -j4
|
||||
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
|
||||
|
||||
FROM alpine
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
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-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
libevent \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=0.20.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,53 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN useradd --system --user-group bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=0.21.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& for key in \
|
||||
01EA5486DE18A882D4C2684590C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS.asc | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
|
||||
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,127 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 libtool
|
||||
RUN apk --no-cache add linux-headers
|
||||
RUN apk --no-cache add sqlite-dev
|
||||
RUN apk --no-cache add zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
90C8019E36C2E964 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done
|
||||
|
||||
ENV BITCOIN_VERSION=0.21.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
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
|
||||
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS.asc | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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-sqlite=yes \
|
||||
--with-daemon
|
||||
RUN make -j4
|
||||
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
|
||||
|
||||
FROM alpine
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup -S bitcoin
|
||||
RUN adduser -G bitcoin -H -S bitcoin
|
||||
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-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
sqlite-dev \
|
||||
libevent \
|
||||
libzmq \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=0.21.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,67 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=22.0
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& for key in \
|
||||
0CCBAAFD76A2ECE2CCD3141DE2FFD5B1D88CA97D \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
28F5900B1BB5D1A4B6B6D1A9ED357015286A333D \
|
||||
637DB1E23370F84AFF88CCE03152347D07DA627C \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
6E01EEC9656903B0542B8F1003DB6322267C373B \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
82921A4B88FD454B7EB8CE3C796C4109063D4EAF \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
|
||||
74E2DEF5D77260B98BC19438099BAD163C70FBFA \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,140 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 libtool
|
||||
RUN apk --no-cache add linux-headers
|
||||
RUN apk --no-cache add sqlite-dev
|
||||
RUN apk --no-cache add zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
0CCBAAFD76A2ECE2CCD3141DE2FFD5B1D88CA97D \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
28F5900B1BB5D1A4B6B6D1A9ED357015286A333D \
|
||||
637DB1E23370F84AFF88CCE03152347D07DA627C \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
6E01EEC9656903B0542B8F1003DB6322267C373B \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
82921A4B88FD454B7EB8CE3C796C4109063D4EAF \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
|
||||
74E2DEF5D77260B98BC19438099BAD163C70FBFA \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done
|
||||
|
||||
ENV BITCOIN_VERSION=22.0
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
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 grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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-sqlite=yes \
|
||||
--with-daemon
|
||||
RUN make -j4
|
||||
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
|
||||
|
||||
FROM alpine
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup bitcoin --gid ${GID} --system
|
||||
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
|
||||
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-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
libevent \
|
||||
libzmq \
|
||||
shadow \
|
||||
sqlite-dev \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=22.0
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,71 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=23.0
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
28F5900B1BB5D1A4B6B6D1A9ED357015286A333D \
|
||||
637DB1E23370F84AFF88CCE03152347D07DA627C \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
F9A8737BF4FF5C89C903DF31DD78544CF91B1514 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
E463A93F5F3117EEDE6C7316BD02942421F4889F \
|
||||
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
|
||||
4DAF18FE948E7A965B30F9457E296D555E7F63A7 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
74E2DEF5D77260B98BC19438099BAD163C70FBFA \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SL https://raw.githubusercontent.com/Kvaciral/kvaciral/main/kvaciral.asc | gpg --import \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,146 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX}
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 libtool
|
||||
RUN apk --no-cache add linux-headers
|
||||
RUN apk --no-cache add sqlite-dev
|
||||
RUN apk --no-cache add zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
28F5900B1BB5D1A4B6B6D1A9ED357015286A333D \
|
||||
637DB1E23370F84AFF88CCE03152347D07DA627C \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
F9A8737BF4FF5C89C903DF31DD78544CF91B1514 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
E463A93F5F3117EEDE6C7316BD02942421F4889F \
|
||||
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
|
||||
4DAF18FE948E7A965B30F9457E296D555E7F63A7 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
74E2DEF5D77260B98BC19438099BAD163C70FBFA \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done && \
|
||||
wget -O- https://raw.githubusercontent.com/Kvaciral/kvaciral/main/kvaciral.asc | gpg --import
|
||||
|
||||
ENV BITCOIN_VERSION=23.0
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
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 grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
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-sqlite=yes \
|
||||
--with-daemon
|
||||
RUN make -j4
|
||||
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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup bitcoin --gid ${GID} --system
|
||||
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
|
||||
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-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
sqlite-dev \
|
||||
libevent \
|
||||
libzmq \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=23.0
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,39 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,66 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=24.0.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
3EB0DEE6004A13BE5A0CC758BF2978B068054311 \
|
||||
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,89 +0,0 @@
|
||||
FROM debian:bullseye-slim as base
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
ENV BITCOIN_VERSION=24.0.1
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin
|
||||
|
||||
FROM base as builder
|
||||
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y curl gnupg git ca-certificates autoconf automake build-essential \
|
||||
libboost-filesystem-dev libboost-system-dev libboost-thread-dev libevent-dev \
|
||||
libsqlite3-dev libtool pkg-config libzmq3-dev --no-install-recommends \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
3EB0DEE6004A13BE5A0CC758BF2978B068054311 \
|
||||
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}.tar.gz" SHA256SUMS | sha256sum -c - \
|
||||
&& mkdir /build \
|
||||
&& tar -xzf *.tar.gz -C /build \
|
||||
&& rm *.tar.gz *.asc
|
||||
|
||||
RUN cd /build/bitcoin-${BITCOIN_VERSION} && \
|
||||
./autogen.sh && \
|
||||
./configure \
|
||||
--prefix=/opt/bitcoin-${BITCOIN_VERSION} \
|
||||
--disable-wallet \
|
||||
--disable-bench \
|
||||
--disable-gui-tests \
|
||||
--disable-maintainer-mode \
|
||||
--disable-man \
|
||||
--disable-tests \
|
||||
--with-daemon=yes \
|
||||
--with-gui=no \
|
||||
--with-qrencode=no \
|
||||
--with-utils=yes
|
||||
|
||||
RUN cd /build/bitcoin-${BITCOIN_VERSION} && \
|
||||
curl -SLO https://raw.githubusercontent.com/twofaktor/minibolt/main/resources/ordisrespector.patch && \
|
||||
git apply ordisrespector.patch && \
|
||||
make -j$(nproc) && \
|
||||
make install
|
||||
|
||||
FROM base as runner
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y gosu libevent-2.1-7 libevent-pthreads-2.1-7 libzmq5 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
COPY --from=builder /opt/bitcoin-${BITCOIN_VERSION} /opt/bitcoin-${BITCOIN_VERSION}
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
CMD ["bitcoind"]
|
@ -1,138 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX} --build=aarch64-unknown-linux-gnu
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 libtool
|
||||
RUN apk --no-cache add linux-headers
|
||||
RUN apk --no-cache add sqlite-dev
|
||||
RUN apk --no-cache add zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
3EB0DEE6004A13BE5A0CC758BF2978B068054311 \
|
||||
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done
|
||||
|
||||
ENV BITCOIN_VERSION=24.0.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
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 grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
WORKDIR /bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat/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-sqlite=yes \
|
||||
--with-daemon
|
||||
RUN make -j4
|
||||
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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup bitcoin --gid ${GID} --system
|
||||
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
|
||||
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-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
libevent \
|
||||
libzmq \
|
||||
shadow \
|
||||
sqlite-dev \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=24.0.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,69 +0,0 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG UID=101
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN groupadd --gid ${GID} bitcoin \
|
||||
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
|
||||
&& apt-get update -y \
|
||||
&& apt-get install -y curl gnupg gosu \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ENV BITCOIN_VERSION=26.0
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
|
||||
|
||||
RUN set -ex \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
|
||||
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
|
||||
&& gpg --keyserver hkps://keys.openpgp.org --refresh-keys \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
3EB0DEE6004A13BE5A0CC758BF2978B068054311 \
|
||||
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF \
|
||||
616516B8EB6ED02882FC4A7A8ADCB558C4F33D65 \
|
||||
6A8F9C266528E25AEB1D7731C2371D91CB716EA7 \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS \
|
||||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \
|
||||
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
|
||||
&& grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS | sha256sum -c - \
|
||||
&& tar -xzf *.tar.gz -C /opt \
|
||||
&& rm *.tar.gz *.asc \
|
||||
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,138 +0,0 @@
|
||||
# Build stage for BerkeleyDB
|
||||
FROM alpine as berkeleydb
|
||||
|
||||
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 build-base
|
||||
RUN apk --no-cache add libressl
|
||||
|
||||
ENV BERKELEYDB_VERSION=db-4.8.30.NC
|
||||
ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION}
|
||||
|
||||
RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz
|
||||
RUN tar -xzf *.tar.gz
|
||||
RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h
|
||||
RUN mkdir -p ${BERKELEYDB_PREFIX}
|
||||
|
||||
WORKDIR /${BERKELEYDB_VERSION}/build_unix
|
||||
|
||||
RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX} --build=aarch64-unknown-linux-gnu
|
||||
RUN make -j4
|
||||
RUN make install
|
||||
RUN rm -rf ${BERKELEYDB_PREFIX}/docs
|
||||
|
||||
# Build stage for Bitcoin Core
|
||||
FROM alpine as bitcoin-core
|
||||
|
||||
COPY --from=berkeleydb /opt /opt
|
||||
|
||||
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 libtool
|
||||
RUN apk --no-cache add linux-headers
|
||||
RUN apk --no-cache add sqlite-dev
|
||||
RUN apk --no-cache add zeromq-dev
|
||||
RUN set -ex \
|
||||
&& for key in \
|
||||
152812300785C96444D3334D17565732E08E5E41 \
|
||||
0AD83877C1F0CD1EE9BD660AD7CC770B81FD22A8 \
|
||||
590B7292695AFFA5B672CBB2E13FC145CD3F4304 \
|
||||
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
|
||||
F4FC70F07310028424EFC20A8E4256593F177720 \
|
||||
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
|
||||
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
|
||||
9DEAE0DC7063249FB05474681E4AED62986CD25D \
|
||||
3EB0DEE6004A13BE5A0CC758BF2978B068054311 \
|
||||
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
|
||||
28E72909F1717FE9607754F8A7BEB2621678D37D \
|
||||
79D00BAC68B56D422F945A8F8E3A8F3247DBCBBF \
|
||||
; do \
|
||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
|
||||
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
|
||||
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
|
||||
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
|
||||
done
|
||||
|
||||
ENV BITCOIN_VERSION=24.0.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
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 grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
|
||||
RUN tar -xzf *.tar.gz
|
||||
|
||||
WORKDIR /bitcoin-${BITCOIN_VERSION}
|
||||
|
||||
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat/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-sqlite=yes \
|
||||
--with-daemon
|
||||
RUN make -j4
|
||||
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
|
||||
|
||||
ARG UID=100
|
||||
ARG GID=101
|
||||
|
||||
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
|
||||
maintainer.1="Pedro Branco (@pedrobranco)" \
|
||||
maintainer.2="Rui Marinho (@ruimarinho)"
|
||||
|
||||
RUN addgroup bitcoin --gid ${GID} --system
|
||||
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
|
||||
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-filesystem \
|
||||
boost-system \
|
||||
boost-thread \
|
||||
libevent \
|
||||
libzmq \
|
||||
shadow \
|
||||
sqlite-dev \
|
||||
su-exec
|
||||
|
||||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
|
||||
ENV BITCOIN_VERSION=24.0.1
|
||||
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
|
||||
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
|
||||
|
||||
COPY --from=bitcoin-core /opt /opt
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
|
||||
VOLUME ["/home/bitcoin/.bitcoin"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18444
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
|
||||
|
||||
CMD ["bitcoind"]
|
@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
# Fix permissions for home dir.
|
||||
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
|
||||
# Fix permissions for bitcoin data dir.
|
||||
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec su-exec bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
|
||||
usermod -u "$UID" bitcoin
|
||||
fi
|
||||
|
||||
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
|
||||
groupmod -g "$GID" bitcoin
|
||||
fi
|
||||
|
||||
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ]; then
|
||||
echo "$0: assuming arguments for bitcoind"
|
||||
|
||||
set -- bitcoind "$@"
|
||||
fi
|
||||
|
||||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
chmod 700 "$BITCOIN_DATA"
|
||||
|
||||
echo "$0: setting data directory to $BITCOIN_DATA"
|
||||
|
||||
set -- "$@" -datadir="$BITCOIN_DATA"
|
||||
fi
|
||||
|
||||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
|
||||
echo
|
||||
exec gosu bitcoin "$@"
|
||||
fi
|
||||
|
||||
echo
|
||||
exec "$@"
|
76
README.md
76
README.md
@ -1,55 +1,22 @@
|
||||
# ruimarinho/bitcoin-core
|
||||
|
||||
A bitcoin-core docker image with support for the following platforms:
|
||||
A bitcoin-core docker image.
|
||||
|
||||
* `amd64` (x86_64)
|
||||
* `arm32v7` (armv7)
|
||||
* `arm64` (aarch64, armv8)
|
||||
|
||||
[![ruimarinho/bitcoin-core][docker-pulls-image]][docker-hub-url] [![ruimarinho/bitcoin-core][docker-stars-image]][docker-hub-url] [![ruimarinho/bitcoin-core][docker-size-image]][docker-hub-url]
|
||||
[![ruimarinho/bitcoin-core][docker-pulls-image]][docker-hub-url] [![ruimarinho/bitcoin-core][docker-stars-image]][docker-hub-url] [![ruimarinho/bitcoin-core][docker-size-image]][docker-hub-url] [![ruimarinho/bitcoin-core][docker-layers-image]][docker-hub-url]
|
||||
|
||||
## Tags
|
||||
|
||||
- `24.0.1`, `24`, `latest` ([24/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/24/Dockerfile)) [**multi-arch**]
|
||||
- `24.0.1-alpine`, `24-alpine` ([24/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/24/alpine/Dockerfile))
|
||||
|
||||
- `23.0`, `23` ([23/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/23/Dockerfile)) [**multi-arch**]
|
||||
- `23.0-alpine`, `23-alpine` ([23/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/23/alpine/Dockerfile))
|
||||
|
||||
- `22.0`, `22`, ([22/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/22/Dockerfile)) [**multi-arch**]
|
||||
- `22.0-alpine`, `22-alpine` ([22/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/22/alpine/Dockerfile))
|
||||
|
||||
- `0.21.1`, `0.21` ([0.21/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.21/Dockerfile)) [**multi-arch**]
|
||||
- `0.21.1-alpine`, `0.21-alpine` ([0.21/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.21/alpine/Dockerfile))
|
||||
|
||||
- `0.20.1`, `0.20` ([0.20/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.20/Dockerfile)) [**multi-arch**]
|
||||
- `0.20.1-alpine`, `0.20-alpine` ([0.20/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.20/alpine/Dockerfile))
|
||||
|
||||
- `0.19.1`, `0.19` ([0.19/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.19/Dockerfile)) [**multi-arch**]
|
||||
- `0.19.1-alpine`, `0.19-alpine` ([0.19/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.19/alpine/Dockerfile))
|
||||
|
||||
- `0.18.1`, `0.18`, ([0.18/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.18/Dockerfile))
|
||||
- `0.18.1-alpine`, `0.18-alpine` ([0.18/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.18/alpine/Dockerfile))
|
||||
|
||||
- `0.17.1`, `0.17` ([0.17/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.17/Dockerfile))
|
||||
- `0.17.1-alpine`, `0.17-alpine` ([0.17/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.17/alpine/Dockerfile))
|
||||
|
||||
- `0.16.3`, `0.16` ([0.16/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.16/Dockerfile))
|
||||
- `0.16.3`, `0.16`, `latest` ([0.16/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.16/Dockerfile))
|
||||
- `0.16.3-alpine`, `0.16-alpine` ([0.16/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.16/alpine/Dockerfile))
|
||||
|
||||
- `0.15.1`, `0.15` ([0.15/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.15/Dockerfile))
|
||||
- `0.15.1-alpine`, `0.15-alpine` ([0.15/alpine/Dockerfile](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/0.15/alpine/Dockerfile))
|
||||
|
||||
**Multi-architecture builds**
|
||||
|
||||
The newest images (Debian-based, *0.19+*) provide built-in support for multiple architectures. Running `docker pull` on any of the supported platforms will automatically choose the right image for you as all of the manifests and artifacts are pushed to the Docker registry.
|
||||
|
||||
**Picking the right tag**
|
||||
|
||||
- `ruimarinho/bitcoin-core:latest`: points to the latest stable release available of Bitcoin Core. Caution when using in production as blindly upgrading Bitcoin Core is a risky procedure.
|
||||
- `ruimarinho/bitcoin-core:alpine`: same as above but using the Alpine Linux distribution (a resource efficient Linux distribution with security in mind, but not officially supported by the Bitcoin Core team — use at your own risk).
|
||||
- `ruimarinho/bitcoin-core:<version>`: based on a slim Debian image, this tag format points to a specific version branch (e.g. `0.20`) or release of Bitcoin Core (e.g. `0.20.1`). Uses the pre-compiled binaries which are distributed by the Bitcoin Core team.
|
||||
- `ruimarinho/bitcoin-core:<version>-alpine`: same as above but using the Alpine Linux distribution.
|
||||
- `ruimarinho/bitcoin-core:latest`: points to the latest stable release available of Bitcoin Core. Use this only if you know what you're doing as upgrading Bitcoin Core blindly is a risky procedure.
|
||||
- `ruimarinho/bitcoin-core:<version>`: based on a slim Debian image, points to a specific version branch or release of Bitcoin Core. Uses the pre-compiled binaries which are fully tested by the Bitcoin Core team.
|
||||
- `ruimarinho/bitcoin-core:<version>-alpine`: based on Alpine Linux with Berkeley DB 4.8 (cross-compatible build), points to a specific version branch or release of Bitcoin Core. Uses a simple, resource efficient Linux distribution with security in mind, but is not officially supported by the Bitcoin Core team. Use at your own risk.
|
||||
|
||||
## What is Bitcoin Core?
|
||||
|
||||
@ -71,7 +38,7 @@ This image contains the main binaries from the Bitcoin Core project - `bitcoind`
|
||||
|
||||
_Note: [learn more](#using-rpcauth-for-remote-authentication) about how `-rpcauth` works for remote authentication._
|
||||
|
||||
By default, `bitcoind` will run as user `bitcoin` in the group `bitcoin` for security reasons and with its default data dir set to `~/.bitcoin`. If you'd like to customize where `bitcoin-core` stores its data, you must use the `BITCOIN_DATA` environment variable. The directory will be automatically created with the correct permissions for the `bitcoin` user and `bitcoind` automatically configured to use it.
|
||||
By default, `bitcoind` will run as user `bitcoin` for security reasons and with its default data dir (`~/.bitcoin`). If you'd like to customize where `bitcoin-core` stores its data, you must use the `BITCOIN_DATA` environment variable. The directory will be automatically created with the correct permissions for the `bitcoin` user and `bitcoin-core` automatically configured to use it.
|
||||
|
||||
```sh
|
||||
❯ docker run --env BITCOIN_DATA=/var/lib/bitcoin-core --rm -it ruimarinho/bitcoin-core \
|
||||
@ -79,7 +46,7 @@ By default, `bitcoind` will run as user `bitcoin` in the group `bitcoin` for sec
|
||||
-regtest=1
|
||||
```
|
||||
|
||||
You can also mount a directory in a volume under `/home/bitcoin/.bitcoin` in case you want to access it on the host:
|
||||
You can also mount a directory it in a volume under `/home/bitcoin/.bitcoin` in case you want to access it on the host:
|
||||
|
||||
```sh
|
||||
❯ docker run -v ${PWD}/data:/home/bitcoin/.bitcoin -it --rm ruimarinho/bitcoin-core \
|
||||
@ -97,20 +64,6 @@ bitcoin-core:
|
||||
-regtest=1
|
||||
```
|
||||
|
||||
### Using a custom user id (UID) and group id (GID)
|
||||
|
||||
By default, images are created with a `bitcoin` user/group using a static UID/GID (`101:101` on Debian and `100:101` on Alpine). You may customize the user and group ids using the build arguments `UID` (`--build-arg UID=<uid>`) and `GID` (`--build-arg GID=<gid>`).
|
||||
|
||||
If you'd like to use the pre-built images, uou can also customize the UID/GID on runtime via environment variables `$UID` and `$GID`:
|
||||
|
||||
```sh
|
||||
❯ docker run -e UID=10000 -e GID=10000 -it --rm ruimarinho/bitcoin-core \
|
||||
-printtoconsole \
|
||||
-regtest=1
|
||||
```
|
||||
|
||||
This will recursively change the ownership of the `bitcoin` home directory and `$BITCOIN_DATA` to UID/GID `10000:10000`.
|
||||
|
||||
### Using RPC to interact with the daemon
|
||||
|
||||
There are two communications methods to interact with a running Bitcoin Core daemon.
|
||||
@ -151,9 +104,7 @@ In the background, `bitcoin-cli` read the information automatically from `/home/
|
||||
|
||||
#### Using rpcauth for remote authentication
|
||||
|
||||
Before setting up remote authentication, you will need to generate the `rpcauth` line that will hold the credentials for the Bitcoind Core daemon. You can either do this yourself by constructing the line with the format `<user>:<salt>$<hash>` or use the official [`rpcauth.py`](https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py) script to generate this line for you, including a random password that is printed to the console.
|
||||
|
||||
_Note: This is a Python 3 script. use `[...] | python3 - <username>` when executing on macOS._
|
||||
Before setting up remote authentication, you will need to generate the `rpcauth` line that will hold the credentials for the Bitcoind Core daemon. You can either do this yourself by constructing the line with the format `<user>:<salt>$<hash>` or use the official `rpcauth.py` script to generate this line for you, including a random password that is printed to the console.
|
||||
|
||||
Example:
|
||||
|
||||
@ -225,7 +176,6 @@ docker run --rm -it \
|
||||
-printtoconsole \
|
||||
-regtest=1 \
|
||||
-rpcallowip=172.17.0.0/16 \
|
||||
-rpcbind=0.0.0.0 \
|
||||
-rpcauth='foo:7d9ba5ae63c3d4dc30583ff4fe65a67e$9e3634e81c11659e3de036d0bf88f89cd169c1039e6e09607562d54765c649cc'
|
||||
```
|
||||
|
||||
@ -250,11 +200,6 @@ curl --data-binary '{"jsonrpc":"1.0","id":"1","method":"getnetworkinfo","params"
|
||||
- JSON-RPC/REST: 18443 (_since 0.16+_, otherwise _18332_)
|
||||
- P2P: 18444
|
||||
|
||||
#### Signet
|
||||
|
||||
- JSON-RPC/REST: 38332
|
||||
- P2P: 38333
|
||||
|
||||
## Archived tags
|
||||
|
||||
_Please note that due to [CVE-2018-17144](https://nvd.nist.gov/vuln/detail/CVE-2018-17144), the following tags are unavailable: 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.15.0.1, 0.15.1, 0.16.0, 0.16.1 and 0.16.2._
|
||||
@ -281,6 +226,7 @@ This image is officially supported on Docker version 17.09, with support for old
|
||||
[License information](https://github.com/ruimarinho/docker-bitcoin-core/blob/master/LICENSE) for the [ruimarinho/docker-bitcoin-core][docker-hub-url] docker project.
|
||||
|
||||
[docker-hub-url]: https://hub.docker.com/r/ruimarinho/bitcoin-core
|
||||
[docker-layers-image]: https://img.shields.io/imagelayers/layers/ruimarinho/bitcoin-core/latest.svg?style=flat-square
|
||||
[docker-pulls-image]: https://img.shields.io/docker/pulls/ruimarinho/bitcoin-core.svg?style=flat-square
|
||||
[docker-size-image]: https://img.shields.io/docker/image-size/ruimarinho/bitcoin-core?style=flat-square
|
||||
[docker-size-image]: https://img.shields.io/imagelayers/image-size/ruimarinho/bitcoin-core/latest.svg?style=flat-square
|
||||
[docker-stars-image]: https://img.shields.io/docker/stars/ruimarinho/bitcoin-core.svg?style=flat-square
|
||||
|
Loading…
Reference in New Issue
Block a user