mirror of
https://github.com/sethforprivacy/p2pool-docker.git
synced 2025-12-06 15:52:37 -05:00
- Add comments to each layer
- Implement suggestions made by hadolint (DL3005, DL3009, DL3015) - Bump base images to ubuntu:20.04 and make changes to dependencies accordingly
This commit is contained in:
37
Dockerfile
37
Dockerfile
@@ -1,43 +1,58 @@
|
||||
# From https://github.com/leonardochaia/docker-monerod/blob/master/src/Dockerfile
|
||||
ARG MONERO_BRANCH=v0.17.1.9
|
||||
|
||||
FROM ubuntu:18.04 as build
|
||||
# Select Ubuntu 20.04LTS for the build image base
|
||||
FROM ubuntu:20.04 as build
|
||||
LABEL author="sethsimmons@pm.me" \
|
||||
maintainer="sethsimmons@pm.me"
|
||||
|
||||
# https://github.com/monero-project/monero#compiling-monero-from-source
|
||||
RUN apt-get update && apt-get -y install build-essential cmake \
|
||||
pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev \
|
||||
# Dependency list from https://github.com/monero-project/monero#compiling-monero-from-source
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends build-essential cmake \
|
||||
pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev ca-certificates \
|
||||
libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev \
|
||||
libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev \
|
||||
libusb-dev libprotobuf-dev protobuf-compiler libgtest-dev git \
|
||||
libnorm-dev libpgm-dev libusb-1.0-0-dev libudev-dev
|
||||
libnorm-dev libpgm-dev libusb-1.0-0-dev libudev-dev libgssapi-krb5-2 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Switch to directory for gtest and make/install libs
|
||||
WORKDIR /usr/src/gtest
|
||||
RUN cmake . && make && cp ./lib/libgtest*.a /usr/lib
|
||||
|
||||
RUN cmake . && make && mv libg* /usr/lib/
|
||||
|
||||
# Switch to Monero source directory
|
||||
WORKDIR /monero
|
||||
|
||||
# Git pull Monero source and checkout specified tag/branch
|
||||
ARG MONERO_BRANCH
|
||||
RUN git clone --recursive -b ${MONERO_BRANCH} \
|
||||
https://github.com/monero-project/monero . \
|
||||
&& git submodule init && git submodule update
|
||||
|
||||
RUN make -j8 release-static
|
||||
# Make static Monero binaries
|
||||
RUN make -j4 release-static
|
||||
|
||||
FROM ubuntu:18.04
|
||||
# Select Ubuntu 20.04LTS for the image base
|
||||
FROM ubuntu:20.04
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y
|
||||
RUN apt-get install -y libnorm-dev libpgm-dev
|
||||
# Upgrade image and install remaining dependencies
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y libnorm-dev libpgm-dev libgssapi-krb5-2 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add user and setup directories for monerod
|
||||
RUN useradd -ms /bin/bash monero && mkdir -p /home/monero/.bitmonero \
|
||||
&& chown -R monero:monero /home/monero/.bitmonero
|
||||
USER monero
|
||||
|
||||
# Switch to home directory and install newly built monerod binary
|
||||
WORKDIR /home/monero
|
||||
COPY --chown=monero:monero --from=build /monero/build/Linux/*/release/bin/monerod /usr/local/bin/monerod
|
||||
|
||||
# Expose p2p and restricted RPC ports
|
||||
EXPOSE 18080
|
||||
EXPOSE 18089
|
||||
|
||||
# Start monerod with required --non-interactive flag and sane defaults that are overridden by user input (if applicable)
|
||||
ENTRYPOINT ["monerod", "--non-interactive"]
|
||||
CMD ["--rpc-restricted-bind-ip=0.0.0.0", "--rpc-restricted-bind-port=18089", "--no-igd", "--no-zmq", "--enable-dns-blocklist"]
|
||||
Reference in New Issue
Block a user