2017-11-16 21:14:19 -07:00
|
|
|
# Multistage docker build, requires docker 17.05
|
|
|
|
|
|
|
|
# builder stage
|
|
|
|
FROM ubuntu:16.04 as builder
|
|
|
|
|
2018-03-18 17:07:10 -06:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-16 21:14:19 -07:00
|
|
|
apt-get --no-install-recommends --yes install \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
g++ \
|
|
|
|
make \
|
|
|
|
pkg-config \
|
|
|
|
graphviz \
|
|
|
|
doxygen \
|
2018-02-02 06:45:28 -07:00
|
|
|
git \
|
|
|
|
curl \
|
|
|
|
libtool-bin \
|
|
|
|
autoconf \
|
2018-07-03 10:44:03 -06:00
|
|
|
automake \
|
|
|
|
bzip2
|
2018-02-02 06:45:28 -07:00
|
|
|
|
|
|
|
WORKDIR /usr/local
|
|
|
|
|
2018-07-03 10:44:03 -06:00
|
|
|
#Cmake
|
2018-09-01 06:31:55 -06:00
|
|
|
ARG CMAKE_VERSION=3.12.1
|
2018-08-02 12:42:58 -06:00
|
|
|
ARG CMAKE_VERSION_DOT=v3.12
|
2018-09-01 06:31:55 -06:00
|
|
|
ARG CMAKE_HASH=c53d5c2ce81d7a957ee83e3e635c8cda5dfe20c9d501a4828ee28e1615e57ab2
|
2018-07-03 10:44:03 -06: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 06:45:28 -07:00
|
|
|
## Boost
|
2018-09-01 06:31:55 -06:00
|
|
|
ARG BOOST_VERSION=1_68_0
|
|
|
|
ARG BOOST_VERSION_DOT=1.68.0
|
|
|
|
ARG BOOST_HASH=7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7
|
2018-03-18 17:07:10 -06: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 06:45:28 -07:00
|
|
|
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 \
|
|
|
|
&& cd boost_${BOOST_VERSION} \
|
|
|
|
&& ./bootstrap.sh \
|
2018-03-05 11:28:37 -07: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 06:45:28 -07:00
|
|
|
ENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION}
|
|
|
|
|
|
|
|
# OpenSSL
|
2018-07-03 10:44:03 -06:00
|
|
|
ARG OPENSSL_VERSION=1.1.0h
|
|
|
|
ARG OPENSSL_HASH=5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517
|
2018-03-18 17:07:10 -06: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 06:45:28 -07:00
|
|
|
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \
|
|
|
|
&& cd openssl-${OPENSSL_VERSION} \
|
|
|
|
&& ./Configure linux-x86_64 no-shared --static -fPIC \
|
2018-07-03 10:44:03 -06:00
|
|
|
&& make build_generated \
|
|
|
|
&& make libcrypto.a \
|
2018-02-02 06:45:28 -07:00
|
|
|
&& make install
|
|
|
|
ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}
|
|
|
|
|
|
|
|
# ZMQ
|
2018-07-03 10:44:03 -06:00
|
|
|
ARG ZMQ_VERSION=v4.2.5
|
|
|
|
ARG ZMQ_HASH=d062edd8c142384792955796329baf1e5a3377cd
|
2018-03-18 17:07:10 -06:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} \
|
2018-02-02 06:45:28 -07: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 10:44:03 -06:00
|
|
|
ARG CPPZMQ_VERSION=v4.2.3
|
2018-02-02 06:45:28 -07:00
|
|
|
ARG CPPZMQ_HASH=6aa3ab686e916cb0e62df7fa7d12e0b13ae9fae6
|
2018-03-18 17:07:10 -06:00
|
|
|
RUN set -ex \
|
2018-07-03 10:44:03 -06:00
|
|
|
&& git clone https://github.com/zeromq/cppzmq.git -b ${CPPZMQ_VERSION} \
|
2018-02-02 06:45:28 -07: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 17:07:10 -06: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 06:45:28 -07: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 17:07:10 -06:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} \
|
2018-02-02 06:45:28 -07: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-16 21:14:19 -07:00
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2017-12-11 16:33:08 -07:00
|
|
|
|
|
|
|
ARG NPROC
|
2018-03-18 17:07:10 -06:00
|
|
|
RUN set -ex && \
|
|
|
|
rm -rf build && \
|
|
|
|
if [ -z "$NPROC" ] ; \
|
|
|
|
then make -j$(nproc) release-static ; \
|
|
|
|
else make -j$NPROC release-static ; \
|
|
|
|
fi
|
2017-11-16 21:14:19 -07:00
|
|
|
|
|
|
|
# runtime stage
|
2017-02-23 15:55:37 -07:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
2018-03-18 17:07:10 -06:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-17 23:45:39 -07:00
|
|
|
apt-get --no-install-recommends --yes install ca-certificates && \
|
2017-11-16 21:14:19 -07:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt
|
|
|
|
|
|
|
|
COPY --from=builder /src/build/release/bin/* /usr/local/bin/
|
2016-08-31 10:10:44 -06:00
|
|
|
|
|
|
|
# Contains the blockchain
|
|
|
|
VOLUME /root/.bitmonero
|
|
|
|
|
|
|
|
# Generate your wallet via accessing the container and run:
|
|
|
|
# cd /wallet
|
2017-02-23 15:55:37 -07:00
|
|
|
# monero-wallet-cli
|
2016-08-31 10:10:44 -06:00
|
|
|
VOLUME /wallet
|
|
|
|
|
|
|
|
EXPOSE 18080
|
|
|
|
EXPOSE 18081
|
|
|
|
|
2018-03-18 17:07:10 -06: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 10:44:03 -06:00
|
|
|
|