Browse Source

test

master
Damian Mee 6 years ago
parent
commit
14539165fb
No known key found for this signature in database GPG Key ID: 2F961EAB8789725D
  1. 3
      .travis.yml
  2. 2
      0.17/Dockerfile
  3. 62
      0.18/Dockerfile
  4. 136
      0.18/Dockerfile.bak
  5. 7
      0.18/source/Dockerfile

3
.travis.yml

@ -36,6 +36,9 @@ jobs:
name: "Build Docker image from SOURCE for arm"
env: ARCH=arm FROM=source
- name: "See how fast building toolchain works on Travis"
script: docker build 0.18/
# - name: "Build Docker image from BINARY for arm"
# env: ARCH=arm FROM=binary

2
0.17/Dockerfile

@ -4,6 +4,7 @@ FROM alpine:3.9 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt /opt
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add autoconf
RUN apk --no-cache add automake
@ -69,6 +70,7 @@ FROM alpine:3.9 AS final
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add \
boost \

62
0.18/Dockerfile

@ -0,0 +1,62 @@
# Build stage for Bitcoin Core
FROM alpine:3.9 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC-linux-arm /opt /opt
# Replace `http:` repositories with `https:` ones
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN echo 'https://alpine.global.ssl.fastly.net/alpine/edge/testing' >> /etc/apk/repositories
# install packages necessary to build Bitcoind
RUN apk add --no-cache --update \
autoconf \
automake \
boost-dev \
build-base \
chrpath \
crosstool-ng \
curl \
file \
g++ \
gcc \
git \
gnupg \
libevent-dev \
libressl \
libressl-dev \
libtool \
linux-headers \
make \
protobuf-dev \
tar \
wget \
zeromq-dev
# We are inside Docker container. It's easier to run as root, and no damage can be done anyway… so ¯\_(ツ)_/¯
ENV CT_EXPERIMENTAL=y
ENV CT_ALLOW_BUILD_AS_ROOT=y
ENV CT_ALLOW_BUILD_AS_ROOT_SURE=y
RUN apk add xz patch binutils
RUN ct-ng arm-unknown-linux-musleabi
RUN ct-ng -d build || true
RUN tail -n 200 build.log
# Alpine gotchas:
#
# `apk add --update wget` has to be run.
# Otherwise "wget: unrecognized option: progress=dot:binary" is returned
#
# `apk add --update tor` has to be run.
# Otherwise "tar: invalid tar magic" is returned
#
# `apk add --update patch`
# Otherwise: "/usr/bin/patch: unrecognized option: 0"
#
# Just missing & needs installing: xz strip (part of binutils)

136
0.18/Dockerfile.bak

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

7
0.18/source/Dockerfile

@ -4,7 +4,7 @@ FROM alpine:3.9 AS bitcoin-core
# fetch already built berkeleydb
COPY --from=lncm/berkeleydb:db-4.8.30.NC /opt /opt
# Replace `http:` repositories with `https:` ones
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
# install packages necessary to build Bitcoind
@ -89,10 +89,9 @@ FROM alpine:3.9 AS final
LABEL maintainer.0="nolim1t (@nolim1t)" \
maintainer.1="Damian Mee (@meeDamian)"
# TODO: Eliminating the two RUN lines below is necessary to cross-compile…
# Replace `http:` repositories with `https:` ones
# TODO: Eliminating the two RUN lines below is crucial to make cross-compilation possible…
# Use APK repos over HTTPS. See: https://github.com/gliderlabs/docker-alpine/issues/184
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache --update \
add \
boost \

Loading…
Cancel
Save