This commit is contained in:
parent
c5aaa0274c
commit
b064632f4a
@ -16,7 +16,6 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- dockerd &
|
- dockerd &
|
||||||
- docker login -u kieran -p $TOKEN git.v0l.io
|
- docker login -u kieran -p $TOKEN git.v0l.io
|
||||||
- docker build -t git.v0l.io/kieran/bitcoin-core:latest 24/
|
- docker buildx build -t git.v0l.io/kieran/bitcoin:latest --push 26/
|
||||||
- docker push git.v0l.io/kieran/nostr-services:latest
|
|
||||||
- kill $(cat /var/run/docker.pid)
|
- kill $(cat /var/run/docker.pid)
|
||||||
|
|
||||||
|
69
26/Dockerfile
Normal file
69
26/Dockerfile
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
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"]
|
138
26/alpine/Dockerfile
Normal file
138
26/alpine/Dockerfile
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
# 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"]
|
39
26/alpine/docker-entrypoint.sh
Executable file
39
26/alpine/docker-entrypoint.sh
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/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 "$@"
|
35
26/docker-entrypoint.sh
Executable file
35
26/docker-entrypoint.sh
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/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 "$@"
|
Loading…
Reference in New Issue
Block a user