101 lines
2.8 KiB
Docker
101 lines
2.8 KiB
Docker
# Multistage docker build, requires docker 17.05
|
|
|
|
# builder stage
|
|
FROM ubuntu:20.04 as builder
|
|
|
|
# build dependencies found here:
|
|
# https://github.com/monero-project/monero/blob/release-v0.17/.github/workflows/build.yml
|
|
# https://github.com/monero-project/monero/tree/release-v0.17#dependencies
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
COPY build-dependencies.txt /tmp
|
|
|
|
RUN apt-get update && \
|
|
xargs -a /tmp/build-dependencies.txt apt-get --no-install-recommends --yes install && \
|
|
rm -v /tmp/build-dependencies.txt
|
|
|
|
WORKDIR /src
|
|
|
|
#ENV CFLAGS='-fPIC'
|
|
#ENV CXXFLAGS='-fPIC'
|
|
|
|
COPY monero /src/
|
|
RUN apt-get install --yes git
|
|
|
|
ARG NPROC=8
|
|
ARG BRANCH=release-v0.17
|
|
|
|
RUN mkdir /src/build
|
|
|
|
ENV PATH "/src/build/release/bin:$PATH"
|
|
# x86_64-linux lib
|
|
#RUN make -j$NPROC depends target=x86_64-linux-gnu
|
|
# -e: values from environment override assignments in the Makefile
|
|
ENV subbuilddir "Linux/$BRANCH"
|
|
ENV dotgit "/tmp"
|
|
|
|
#RUN apt-get install --yes git
|
|
#RUN make -j$NPROC release-static-linux-x86_64
|
|
RUN make subbuilddir="Linux/$BRANCH" dotgit=/tmp -j$NPROC release-static-linux-x86_64 || true
|
|
#RUN cat /src/build/release/CMakeFiles/CMakeError.log
|
|
#RUN apt-cache policy cmake
|
|
#RUN exit 1
|
|
|
|
|
|
# i686
|
|
#RUN make -j$NPROC depends target=i686-linux-gnu
|
|
#RUN make -j$NPROC release-static-linux-i686
|
|
|
|
RUN apt-get install tree
|
|
RUN tree /src/build/release/bin
|
|
|
|
# Step 18/25 : RUN sha256sum /src/build/release/bin/monerod
|
|
# ---> Running in 27388909f1f6
|
|
# eaa020172cd7cc835f87a8a77f6032871fb6fe5a2fedad741671625db9893a51 /src/build/release/bin/monerod
|
|
#
|
|
# from monerosrc it is:
|
|
# 1cc68662395506627ca76fb81caf9f0ec84a8514c2db8498ec0ed209718fa5e9 /src/build/release/bin/monerod
|
|
#
|
|
# and from using Dockerfile in monerosrc:
|
|
# 3c1fdf3263818a4c764be94c3e44c6c16ebdaf34ad362e66ed4817b7c3034c75
|
|
#
|
|
# should be
|
|
# $ sha256sum monerod
|
|
# 50c8d4f7b32d1ac20d0eb24004c2f549f9b7c70e16543ed40c74f85893267c1b
|
|
RUN sha256sum /src/build/release/bin/monerod
|
|
# ---> Running in 36115a677298
|
|
# Monero 'Oxygen Orion' (v0.17.3.2-unknown)
|
|
# Removing intermediate container 36115a677298
|
|
#
|
|
# from monerosrc it is:
|
|
# Monero 'Oxygen Orion' (v0.17.3.2-release)
|
|
#
|
|
# should be
|
|
# $ ./monerod --version
|
|
# Monero 'Oxygen Orion' (v0.17.3.2-release)
|
|
|
|
RUN /src/build/release/bin/monerod --version
|
|
|
|
|
|
# runtime stage
|
|
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
|
|
|
|
COPY --from=builder /src/build/release/bin /usr/local/bin/
|
|
|
|
# Generate your wallet via accessing the container and run:
|
|
# cd /wallet
|
|
# monero-wallet-cli
|
|
|
|
|
|
EXPOSE 18080
|
|
EXPOSE 18081
|
|
|
|
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", "--pifile=/monero/run/monerod.pid", "--data-dir=/monero/data", "--config-file=/monero/config/monerod.conf"]
|