2017-11-17 04:14:19 +00:00
|
|
|
# Multistage docker build, requires docker 17.05
|
|
|
|
|
|
|
|
# builder stage
|
|
|
|
FROM ubuntu:16.04 as builder
|
|
|
|
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-17 04:14:19 +00:00
|
|
|
apt-get --no-install-recommends --yes install \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
g++ \
|
|
|
|
make \
|
|
|
|
pkg-config \
|
|
|
|
graphviz \
|
|
|
|
doxygen \
|
2018-02-02 13:45:28 +00:00
|
|
|
git \
|
|
|
|
curl \
|
|
|
|
libtool-bin \
|
|
|
|
autoconf \
|
2018-07-03 16:44:03 +00:00
|
|
|
automake \
|
|
|
|
bzip2
|
2018-02-02 13:45:28 +00:00
|
|
|
|
|
|
|
WORKDIR /usr/local
|
|
|
|
|
2018-07-03 16:44:03 +00:00
|
|
|
#Cmake
|
2018-09-01 12:31:55 +00:00
|
|
|
ARG CMAKE_VERSION=3.12.1
|
2018-08-02 18:42:58 +00:00
|
|
|
ARG CMAKE_VERSION_DOT=v3.12
|
2018-09-01 12:31:55 +00:00
|
|
|
ARG CMAKE_HASH=c53d5c2ce81d7a957ee83e3e635c8cda5dfe20c9d501a4828ee28e1615e57ab2
|
2018-07-03 16:44:03 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& curl -s -O https://cmake.org/files/${CMAKE_VERSION_DOT}/cmake-${CMAKE_VERSION}.tar.gz \
|
|
|
|
&& echo "${CMAKE_HASH} cmake-${CMAKE_VERSION}.tar.gz" | sha256sum -c \
|
|
|
|
&& tar -xzf cmake-${CMAKE_VERSION}.tar.gz \
|
|
|
|
&& cd cmake-${CMAKE_VERSION} \
|
|
|
|
&& ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
2018-02-02 13:45:28 +00:00
|
|
|
## Boost
|
2018-09-01 12:31:55 +00:00
|
|
|
ARG BOOST_VERSION=1_68_0
|
|
|
|
ARG BOOST_VERSION_DOT=1.68.0
|
|
|
|
ARG BOOST_HASH=7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
|
|
|
|
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 \
|
|
|
|
&& cd boost_${BOOST_VERSION} \
|
|
|
|
&& ./bootstrap.sh \
|
2018-03-05 18:28:37 +00:00
|
|
|
&& ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale threading=multi threadapi=pthread cflags="-fPIC" cxxflags="-fPIC" stage
|
2018-02-02 13:45:28 +00:00
|
|
|
ENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION}
|
|
|
|
|
|
|
|
# OpenSSL
|
2018-07-03 16:44:03 +00:00
|
|
|
ARG OPENSSL_VERSION=1.1.0h
|
|
|
|
ARG OPENSSL_HASH=5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& curl -s -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
|
|
|
|
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \
|
|
|
|
&& cd openssl-${OPENSSL_VERSION} \
|
|
|
|
&& ./Configure linux-x86_64 no-shared --static -fPIC \
|
2018-07-03 16:44:03 +00:00
|
|
|
&& make build_generated \
|
|
|
|
&& make libcrypto.a \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& make install
|
|
|
|
ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}
|
|
|
|
|
|
|
|
# ZMQ
|
2018-07-03 16:44:03 +00:00
|
|
|
ARG ZMQ_VERSION=v4.2.5
|
|
|
|
ARG ZMQ_HASH=d062edd8c142384792955796329baf1e5a3377cd
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& cd libzmq \
|
|
|
|
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 \
|
|
|
|
&& ./autogen.sh \
|
|
|
|
&& CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --enable-static --disable-shared \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig
|
|
|
|
|
|
|
|
# zmq.hpp
|
2018-07-03 16:44:03 +00:00
|
|
|
ARG CPPZMQ_VERSION=v4.2.3
|
2018-02-02 13:45:28 +00:00
|
|
|
ARG CPPZMQ_HASH=6aa3ab686e916cb0e62df7fa7d12e0b13ae9fae6
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex \
|
2018-07-03 16:44:03 +00:00
|
|
|
&& git clone https://github.com/zeromq/cppzmq.git -b ${CPPZMQ_VERSION} \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& cd cppzmq \
|
|
|
|
&& test `git rev-parse HEAD` = ${CPPZMQ_HASH} || exit 1 \
|
|
|
|
&& mv *.hpp /usr/local/include
|
|
|
|
|
|
|
|
# Readline
|
|
|
|
ARG READLINE_VERSION=7.0
|
|
|
|
ARG READLINE_HASH=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& curl -s -O https://ftp.gnu.org/gnu/readline/readline-${READLINE_VERSION}.tar.gz \
|
|
|
|
&& echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" | sha256sum -c \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& tar -xzf readline-${READLINE_VERSION}.tar.gz \
|
|
|
|
&& cd readline-${READLINE_VERSION} \
|
|
|
|
&& CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
|
|
|
# Sodium
|
|
|
|
ARG SODIUM_VERSION=1.0.16
|
|
|
|
ARG SODIUM_HASH=675149b9b8b66ff44152553fb3ebf9858128363d
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} \
|
2018-02-02 13:45:28 +00:00
|
|
|
&& cd libsodium \
|
|
|
|
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 \
|
|
|
|
&& ./autogen.sh \
|
|
|
|
&& CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make check \
|
|
|
|
&& make install
|
2017-11-17 04:14:19 +00:00
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2017-12-11 23:33:08 +00:00
|
|
|
|
2018-09-24 22:14:12 +00:00
|
|
|
ENV USE_SINGLE_BUILDDIR=1
|
2017-12-11 23:33:08 +00:00
|
|
|
ARG NPROC
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex && \
|
2018-10-13 21:13:43 +00:00
|
|
|
git submodule init && git submodule update && \
|
2018-03-18 23:07:10 +00:00
|
|
|
rm -rf build && \
|
|
|
|
if [ -z "$NPROC" ] ; \
|
|
|
|
then make -j$(nproc) release-static ; \
|
|
|
|
else make -j$NPROC release-static ; \
|
|
|
|
fi
|
2017-11-17 04:14:19 +00:00
|
|
|
|
|
|
|
# runtime stage
|
2017-02-23 22:55:37 +00:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
2018-03-18 23:07:10 +00:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-18 06:45:39 +00:00
|
|
|
apt-get --no-install-recommends --yes install ca-certificates && \
|
2017-11-17 04:14:19 +00:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt
|
2018-09-24 22:14:12 +00:00
|
|
|
COPY --from=builder /src/build/release/bin /usr/local/bin/
|
2016-08-31 16:10:44 +00:00
|
|
|
|
|
|
|
# Contains the blockchain
|
|
|
|
VOLUME /root/.bitmonero
|
|
|
|
|
|
|
|
# Generate your wallet via accessing the container and run:
|
|
|
|
# cd /wallet
|
2017-02-23 22:55:37 +00:00
|
|
|
# monero-wallet-cli
|
2016-08-31 16:10:44 +00:00
|
|
|
VOLUME /wallet
|
|
|
|
|
|
|
|
EXPOSE 18080
|
|
|
|
EXPOSE 18081
|
|
|
|
|
2018-03-18 23:07:10 +00:00
|
|
|
ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"]
|
2018-07-03 16:44:03 +00:00
|
|
|
|