monero/Dockerfile

67 lines
1.6 KiB
Text
Raw Normal View History

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