2017-11-17 06:14:19 +02:00
|
|
|
# Multistage docker build, requires docker 17.05
|
|
|
|
|
|
|
|
# builder stage
|
2021-09-12 01:05:56 +03:00
|
|
|
FROM ubuntu:20.04 as builder
|
2017-11-17 06:14:19 +02:00
|
|
|
|
2018-03-19 01:07:10 +02:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2021-09-12 01:05:56 +03:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --yes install \
|
|
|
|
automake \
|
|
|
|
autotools-dev \
|
|
|
|
bsdmainutils \
|
|
|
|
build-essential \
|
2017-11-17 06:14:19 +02:00
|
|
|
ca-certificates \
|
2021-09-12 01:05:56 +03:00
|
|
|
ccache \
|
2017-11-17 06:14:19 +02:00
|
|
|
cmake \
|
2018-02-02 15:45:28 +02:00
|
|
|
curl \
|
2021-09-12 01:05:56 +03:00
|
|
|
git \
|
|
|
|
libtool \
|
|
|
|
pkg-config \
|
|
|
|
gperf
|
2018-12-04 23:01:03 +02:00
|
|
|
|
2017-11-17 06:14:19 +02:00
|
|
|
WORKDIR /src
|
|
|
|
COPY . .
|
2017-12-12 01:33:08 +02:00
|
|
|
|
|
|
|
ARG NPROC
|
2018-03-19 01:07:10 +02:00
|
|
|
RUN set -ex && \
|
2018-10-14 00:13:43 +03:00
|
|
|
git submodule init && git submodule update && \
|
2018-03-19 01:07:10 +02:00
|
|
|
rm -rf build && \
|
|
|
|
if [ -z "$NPROC" ] ; \
|
2021-09-12 01:05:56 +03:00
|
|
|
then make -j$(nproc) depends target=x86_64-linux-gnu ; \
|
|
|
|
else make -j$NPROC depends target=x86_64-linux-gnu ; \
|
2018-03-19 01:07:10 +02:00
|
|
|
fi
|
2017-11-17 06:14:19 +02:00
|
|
|
|
|
|
|
# runtime stage
|
2021-09-12 01:05:56 +03:00
|
|
|
FROM ubuntu:20.04
|
2017-02-24 00:55:37 +02:00
|
|
|
|
2018-03-19 01:07:10 +02:00
|
|
|
RUN set -ex && \
|
|
|
|
apt-get update && \
|
2017-11-18 08:45:39 +02:00
|
|
|
apt-get --no-install-recommends --yes install ca-certificates && \
|
2017-11-17 06:14:19 +02:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt
|
2021-09-12 01:05:56 +03:00
|
|
|
COPY --from=builder /src/build/x86_64-linux-gnu/release/bin /usr/local/bin/
|
2016-08-31 19:10:44 +03:00
|
|
|
|
2019-03-10 00:22:03 +02: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 19:10:44 +03:00
|
|
|
# Contains the blockchain
|
2019-03-10 00:22:03 +02:00
|
|
|
VOLUME /home/monero/.bitmonero
|
2016-08-31 19:10:44 +03:00
|
|
|
|
|
|
|
# Generate your wallet via accessing the container and run:
|
|
|
|
# cd /wallet
|
2017-02-24 00:55:37 +02:00
|
|
|
# monero-wallet-cli
|
2016-08-31 19:10:44 +03:00
|
|
|
VOLUME /wallet
|
|
|
|
|
|
|
|
EXPOSE 18080
|
|
|
|
EXPOSE 18081
|
|
|
|
|
2019-03-10 00:22:03 +02:00
|
|
|
# switch to user monero
|
|
|
|
USER monero
|
|
|
|
|
2021-12-31 11:05:22 +02:00
|
|
|
ENTRYPOINT ["monerod"]
|
|
|
|
CMD ["--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 19:44:03 +03:00
|
|
|
|