p2pool/docker-compose/monero/Dockerfile

60 lines
1.6 KiB
Text
Raw Normal View History

# 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"
RUN set -e && \
apt-get update -q -y --no-install-recommends && \
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
automake \
autotools-dev \
bsdmainutils \
build-essential \
ca-certificates \
ccache \
cmake \
curl \
git \
libtool \
pkg-config \
gperf
WORKDIR /src
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 && \
git checkout $MONERO_GIT_TAG && \
git submodule sync && git submodule update --init --force --recursive && \
make -j$(nproc) depends target=$(contrib/depends/config.guess)
# ---
# runtime stage
FROM ubuntu:20.04
COPY --from=0 /src/monero/build/*/release/bin /usr/local/bin/
RUN set -e && \
apt-get update -q -y --no-install-recommends && \
DEBIAN_FRONTEND="noninteractive" apt-get install -q -y --no-install-recommends \
ca-certificates \
netcat \
&& \
apt-get clean && \
rm -rf /var/lib/apt
RUN groupadd -r monero -g 1000 && \
adduser --uid 1000 --gid 1000 --system --disabled-password monero && \
mkdir -p /home/monero/.bitmonero && \
chown -R monero:monero /home/monero/.bitmonero
USER monero
WORKDIR /home/monero
EXPOSE 18080 18081 18083
VOLUME /home/monero/.bitmonero
ENTRYPOINT ["/usr/local/bin/monerod"]