2022-07-17 14:55:16 +00:00
|
|
|
# Multistage docker build, requires docker 17.05
|
|
|
|
|
|
|
|
# builder stage
|
|
|
|
FROM ubuntu:20.04 as builder
|
2021-12-24 19:38:53 +00:00
|
|
|
ARG MONERO_GIT_TAG="latest"
|
2021-11-10 23:35:39 +00:00
|
|
|
|
|
|
|
RUN set -e && \
|
|
|
|
apt-get update -q -y --no-install-recommends && \
|
|
|
|
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
2022-07-17 14:55:16 +00:00
|
|
|
automake \
|
|
|
|
autotools-dev \
|
|
|
|
bsdmainutils \
|
2021-11-10 23:35:39 +00:00
|
|
|
build-essential \
|
2022-07-17 14:55:16 +00:00
|
|
|
ca-certificates \
|
2021-11-10 23:35:39 +00:00
|
|
|
ccache \
|
2022-07-17 14:55:16 +00:00
|
|
|
cmake \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
libtool \
|
|
|
|
pkg-config \
|
|
|
|
gperf
|
2021-11-10 23:35:39 +00:00
|
|
|
|
2022-07-17 14:55:16 +00:00
|
|
|
|
|
|
|
WORKDIR /src
|
2021-11-10 23:35:39 +00:00
|
|
|
RUN git clone --recursive https://github.com/monero-project/monero && \
|
|
|
|
cd monero && \
|
2021-12-24 19:38:53 +00:00
|
|
|
if [ "x$MONERO_GIT_TAG" = "xlatest" ]; then MONERO_GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)); fi && \
|
2021-11-10 23:35:39 +00:00
|
|
|
git checkout $MONERO_GIT_TAG && \
|
|
|
|
git submodule sync && git submodule update --init --force --recursive && \
|
2022-07-17 14:55:16 +00:00
|
|
|
make -j$(nproc) depends target=$(contrib/depends/config.guess)
|
2021-11-10 23:35:39 +00:00
|
|
|
|
|
|
|
# ---
|
|
|
|
|
2022-07-17 14:55:16 +00:00
|
|
|
# runtime stage
|
2022-06-01 17:44:55 +00:00
|
|
|
FROM ubuntu:20.04
|
2021-11-10 23:35:39 +00:00
|
|
|
|
2022-07-17 14:55:16 +00:00
|
|
|
COPY --from=0 /src/monero/build/*/release/bin /usr/local/bin/
|
2021-11-10 23:35:39 +00:00
|
|
|
|
|
|
|
RUN set -e && \
|
|
|
|
apt-get update -q -y --no-install-recommends && \
|
|
|
|
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
|
2022-07-17 14:55:16 +00:00
|
|
|
ca-certificates \
|
|
|
|
netcat \
|
|
|
|
&& \
|
2022-06-14 05:27:20 +00:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt
|
2021-11-10 23:35:39 +00:00
|
|
|
|
|
|
|
RUN groupadd -r monero -g 1000 && \
|
2022-07-17 14:55:16 +00:00
|
|
|
adduser --uid 1000 --gid 1000 --system --disabled-password monero && \
|
|
|
|
mkdir -p /home/monero/.bitmonero && \
|
|
|
|
chown -R monero:monero /home/monero/.bitmonero
|
|
|
|
|
2021-11-10 23:35:39 +00:00
|
|
|
USER monero
|
2022-07-17 14:55:16 +00:00
|
|
|
WORKDIR /home/monero
|
2021-11-10 23:35:39 +00:00
|
|
|
|
|
|
|
EXPOSE 18080 18081 18083
|
|
|
|
VOLUME /home/monero/.bitmonero
|
|
|
|
|
2022-07-17 14:55:16 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/monerod"]
|