2017-11-17 05:14:19 +01:00
|
|
|
# Multistage docker build, requires docker 17.05
|
|
|
|
|
|
|
|
# builder stage
|
|
|
|
FROM ubuntu:16.04 as builder
|
|
|
|
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-17 05:14:19 +01:00
|
|
|
apt-get --no-install-recommends --yes install \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
g++ \
|
|
|
|
make \
|
|
|
|
pkg-config \
|
|
|
|
graphviz \
|
|
|
|
doxygen \
|
2018-02-02 14:45:28 +01:00
|
|
|
git \
|
|
|
|
curl \
|
|
|
|
libtool-bin \
|
|
|
|
autoconf \
|
2018-07-03 18:44:03 +02:00
|
|
|
automake \
|
2018-10-29 09:17:32 +01:00
|
|
|
bzip2 \
|
|
|
|
xsltproc \
|
2018-12-04 22:01:03 +01:00
|
|
|
gperf \
|
|
|
|
unzip
|
2018-02-02 14:45:28 +01:00
|
|
|
|
|
|
|
WORKDIR /usr/local
|
|
|
|
|
2019-03-19 13:55:00 +01:00
|
|
|
ENV CFLAGS='-fPIC'
|
|
|
|
ENV CXXFLAGS='-fPIC'
|
|
|
|
|
2018-07-03 18:44:03 +02:00
|
|
|
#Cmake
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG CMAKE_VERSION=3.14.6
|
2019-03-19 13:55:00 +01:00
|
|
|
ARG CMAKE_VERSION_DOT=v3.14
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG CMAKE_HASH=4e8ea11cabe459308671b476469eace1622e770317a15951d7b55a82ccaaccb9
|
2018-07-03 18:44:03 +02: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 14:45:28 +01:00
|
|
|
## Boost
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG BOOST_VERSION=1_70_0
|
|
|
|
ARG BOOST_VERSION_DOT=1.70.0
|
|
|
|
ARG BOOST_HASH=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex \
|
2021-04-26 19:54:25 +02:00
|
|
|
&& curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION_DOT}/boost_${BOOST_VERSION}.tar.bz2 \
|
2018-03-19 00:07:10 +01:00
|
|
|
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 \
|
|
|
|
&& cd boost_${BOOST_VERSION} \
|
|
|
|
&& ./bootstrap.sh \
|
2019-03-19 13:55:00 +01: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="$CFLAGS" cxxflags="$CXXFLAGS" stage
|
2018-02-02 14:45:28 +01:00
|
|
|
ENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION}
|
|
|
|
|
|
|
|
# OpenSSL
|
2021-01-26 12:27:08 +01:00
|
|
|
ARG OPENSSL_VERSION=1.1.1i
|
|
|
|
ARG OPENSSL_HASH=e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
|
2018-03-19 00:07:10 +01: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 14:45:28 +01:00
|
|
|
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \
|
|
|
|
&& cd openssl-${OPENSSL_VERSION} \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./Configure linux-x86_64 no-shared --static "$CFLAGS" \
|
2018-07-03 18:44:03 +02:00
|
|
|
&& make build_generated \
|
|
|
|
&& make libcrypto.a \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& make install
|
|
|
|
ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}
|
|
|
|
|
|
|
|
# ZMQ
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG ZMQ_VERSION=v4.3.2
|
|
|
|
ARG ZMQ_HASH=a84ffa12b2eb3569ced199660bac5ad128bff1f0
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& cd libzmq \
|
|
|
|
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 \
|
|
|
|
&& ./autogen.sh \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure --enable-static --disable-shared \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig
|
|
|
|
|
|
|
|
# zmq.hpp
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG CPPZMQ_VERSION=v4.4.1
|
|
|
|
ARG CPPZMQ_HASH=f5b36e563598d48fcc0d82e589d3596afef945ae
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex \
|
2018-07-03 18:44:03 +02:00
|
|
|
&& git clone https://github.com/zeromq/cppzmq.git -b ${CPPZMQ_VERSION} \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& cd cppzmq \
|
|
|
|
&& test `git rev-parse HEAD` = ${CPPZMQ_HASH} || exit 1 \
|
|
|
|
&& mv *.hpp /usr/local/include
|
|
|
|
|
|
|
|
# Readline
|
2019-03-19 13:55:00 +01:00
|
|
|
ARG READLINE_VERSION=8.0
|
|
|
|
ARG READLINE_HASH=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461
|
2018-03-19 00:07:10 +01: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 14:45:28 +01:00
|
|
|
&& tar -xzf readline-${READLINE_VERSION}.tar.gz \
|
|
|
|
&& cd readline-${READLINE_VERSION} \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
|
|
|
# Sodium
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG SODIUM_VERSION=1.0.18
|
|
|
|
ARG SODIUM_HASH=4f5e89fa84ce1d178a6765b8b46f2b6f91216677
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& cd libsodium \
|
|
|
|
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 \
|
|
|
|
&& ./autogen.sh \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure \
|
2018-02-02 14:45:28 +01:00
|
|
|
&& make \
|
|
|
|
&& make check \
|
|
|
|
&& make install
|
2017-11-17 05:14:19 +01:00
|
|
|
|
2018-10-29 09:17:32 +01:00
|
|
|
# Udev
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG UDEV_VERSION=v3.2.8
|
|
|
|
ARG UDEV_HASH=d69f3f28348123ab7fa0ebac63ec2fd16800c5e0
|
2018-10-29 09:17:32 +01:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/gentoo/eudev -b ${UDEV_VERSION} \
|
|
|
|
&& cd eudev \
|
|
|
|
&& test `git rev-parse HEAD` = ${UDEV_HASH} || exit 1 \
|
|
|
|
&& ./autogen.sh \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure --disable-gudev --disable-introspection --disable-hwdb --disable-manpages --disable-shared \
|
2018-10-29 09:17:32 +01:00
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
|
|
|
# Libusb
|
|
|
|
ARG USB_VERSION=v1.0.22
|
|
|
|
ARG USB_HASH=0034b2afdcdb1614e78edaa2a9e22d5936aeae5d
|
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/libusb/libusb.git -b ${USB_VERSION} \
|
|
|
|
&& cd libusb \
|
|
|
|
&& test `git rev-parse HEAD` = ${USB_HASH} || exit 1 \
|
|
|
|
&& ./autogen.sh \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure --disable-shared \
|
2018-10-29 09:17:32 +01:00
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
|
|
|
# Hidapi
|
|
|
|
ARG HIDAPI_VERSION=hidapi-0.8.0-rc1
|
|
|
|
ARG HIDAPI_HASH=40cf516139b5b61e30d9403a48db23d8f915f52c
|
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/signal11/hidapi -b ${HIDAPI_VERSION} \
|
|
|
|
&& cd hidapi \
|
|
|
|
&& test `git rev-parse HEAD` = ${HIDAPI_HASH} || exit 1 \
|
|
|
|
&& ./bootstrap \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure --enable-static --disable-shared \
|
2018-10-29 09:17:32 +01:00
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
2018-12-04 22:01:03 +01:00
|
|
|
# Protobuf
|
2019-08-04 23:30:35 +02:00
|
|
|
ARG PROTOBUF_VERSION=v3.7.1
|
|
|
|
ARG PROTOBUF_HASH=6973c3a5041636c1d8dc5f7f6c8c1f3c15bc63d6
|
2018-12-04 22:01:03 +01:00
|
|
|
RUN set -ex \
|
|
|
|
&& git clone https://github.com/protocolbuffers/protobuf -b ${PROTOBUF_VERSION} \
|
|
|
|
&& cd protobuf \
|
|
|
|
&& test `git rev-parse HEAD` = ${PROTOBUF_HASH} || exit 1 \
|
|
|
|
&& git submodule update --init --recursive \
|
|
|
|
&& ./autogen.sh \
|
2019-03-19 13:55:00 +01:00
|
|
|
&& ./configure --enable-static --disable-shared \
|
2018-12-04 22:01:03 +01:00
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig
|
|
|
|
|
2017-11-17 05:14:19 +01:00
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2017-12-12 00:33:08 +01:00
|
|
|
|
2018-09-25 00:14:12 +02:00
|
|
|
ENV USE_SINGLE_BUILDDIR=1
|
2017-12-12 00:33:08 +01:00
|
|
|
ARG NPROC
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex && \
|
2018-10-13 23:13:43 +02:00
|
|
|
git submodule init && git submodule update && \
|
2018-03-19 00:07:10 +01:00
|
|
|
rm -rf build && \
|
|
|
|
if [ -z "$NPROC" ] ; \
|
|
|
|
then make -j$(nproc) release-static ; \
|
|
|
|
else make -j$NPROC release-static ; \
|
|
|
|
fi
|
2017-11-17 05:14:19 +01:00
|
|
|
|
|
|
|
# runtime stage
|
2017-02-23 23:55:37 +01:00
|
|
|
FROM ubuntu:16.04
|
|
|
|
|
2018-03-19 00:07:10 +01:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-18 07:45:39 +01:00
|
|
|
apt-get --no-install-recommends --yes install ca-certificates && \
|
2017-11-17 05:14:19 +01:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt
|
2018-09-25 00:14:12 +02:00
|
|
|
COPY --from=builder /src/build/release/bin /usr/local/bin/
|
2016-08-31 18:10:44 +02:00
|
|
|
|
2019-03-09 23:22:03 +01:00
|
|
|
# Create monero user
|
|
|
|
RUN adduser --system --group --disabled-password monero && \
|
|
|
|
mkdir -p /wallet /home/monero/.bitmonero && \
|
|
|
|
chown -R monero:monero /home/monero/.bitmonero && \
|
|
|
|
chown -R monero:monero /wallet
|
|
|
|
|
2016-08-31 18:10:44 +02:00
|
|
|
# Contains the blockchain
|
2019-03-09 23:22:03 +01:00
|
|
|
VOLUME /home/monero/.bitmonero
|
2016-08-31 18:10:44 +02:00
|
|
|
|
|
|
|
# Generate your wallet via accessing the container and run:
|
|
|
|
# cd /wallet
|
2017-02-23 23:55:37 +01:00
|
|
|
# monero-wallet-cli
|
2016-08-31 18:10:44 +02:00
|
|
|
VOLUME /wallet
|
|
|
|
|
|
|
|
EXPOSE 18080
|
|
|
|
EXPOSE 18081
|
|
|
|
|
2019-03-09 23:22:03 +01:00
|
|
|
# switch to user monero
|
|
|
|
USER monero
|
|
|
|
|
2018-03-19 00:07:10 +01: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 18:44:03 +02:00
|
|
|
|