2022-09-12 20:01:14 +00:00
|
|
|
FROM alpine:latest as builder
|
2023-01-31 12:48:14 +00:00
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
# https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.2.2.tar.bz2
|
2022-09-12 20:01:14 +00:00
|
|
|
# Verification will fail if MONERO_VERSION doesn't match the latest
|
2023-07-19 23:22:49 +00:00
|
|
|
# due to the way monero publishes releases. They overwrite a single hashes.txt
|
|
|
|
# file with each release, meaning we can only grab the SHA256 of the latest
|
|
|
|
# release.
|
2022-12-09 03:10:12 +00:00
|
|
|
# Most publish a asc file for each release / build architecture ¯\_(ツ)_/¯
|
2023-07-19 23:22:49 +00:00
|
|
|
ENV MONERO_VERSION=0.18.2.2
|
2022-09-12 20:01:14 +00:00
|
|
|
ENV GLIBC_VERSION=2.28-r0
|
|
|
|
|
|
|
|
WORKDIR /home/monero
|
|
|
|
|
2023-09-19 16:55:30 +00:00
|
|
|
RUN apk update && apk --no-cache add gcc g++ libc-dev make cmake git
|
|
|
|
RUN git clone https://github.com/microsoft/mimalloc && \
|
|
|
|
cd mimalloc && \
|
|
|
|
mkdir -p out/secure && \
|
|
|
|
cd out/secure && \
|
|
|
|
cmake -DMI_SECURE=ON ../.. && \
|
|
|
|
make && \
|
|
|
|
cp ./libmimalloc-secure.so ../../../libmimalloc.so
|
|
|
|
|
|
|
|
RUN apk --no-cache add gnupg
|
2022-09-12 20:01:14 +00:00
|
|
|
|
2023-07-21 08:27:14 +00:00
|
|
|
# Download Monero
|
2022-09-12 20:01:14 +00:00
|
|
|
RUN wget https://downloads.getmonero.org/cli/monero-linux-x64-v${MONERO_VERSION}.tar.bz2
|
|
|
|
|
|
|
|
# Verify Binary -- fingerprint from https://github.com/monero-project/monero-site/issues/1949
|
|
|
|
ADD ./temp/hashes-v${MONERO_VERSION}.txt .
|
2023-07-19 23:22:49 +00:00
|
|
|
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --keyserver-options no-self-sigs-only --receive-keys 81AC591FE9C4B65C5806AFC3F0AF4D462A0BDF92 && \
|
|
|
|
gpg --verify hashes-v${MONERO_VERSION}.txt && \
|
|
|
|
cat hashes-v${MONERO_VERSION}.txt | grep "$(sha256sum monero-linux-x64-v${MONERO_VERSION}.tar.bz2 | cut -c 1-64)"
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
RUN tar -xvjf monero-linux-x64-v${MONERO_VERSION}.tar.bz2 --strip-components=1
|
|
|
|
|
2023-07-26 08:22:41 +00:00
|
|
|
# Build the actual image
|
|
|
|
FROM alpine:latest as image
|
2023-07-21 08:27:14 +00:00
|
|
|
|
2023-09-19 16:55:30 +00:00
|
|
|
COPY --from=builder /home/monero/libmimalloc.so /usr/lib
|
|
|
|
ENV LD_PRELOAD=libmimalloc.so
|
|
|
|
|
2023-07-26 07:06:01 +00:00
|
|
|
# Upgrade packages
|
2023-09-19 16:55:30 +00:00
|
|
|
RUN apk update && apk upgrade && apk --no-cache add gcompat
|
2023-07-26 07:06:01 +00:00
|
|
|
|
2023-07-30 11:23:14 +00:00
|
|
|
# Switch to a non-root user
|
|
|
|
# System user (not a human), shell of nologin, no password assigned
|
|
|
|
RUN adduser -S -s /sbin/nologin -D monero
|
|
|
|
USER monero
|
|
|
|
|
|
|
|
WORKDIR /home/monero
|
|
|
|
COPY --from=builder --chown=monero /home/monero/monerod /bin
|
|
|
|
ADD scripts /scripts
|
|
|
|
|
2022-09-12 20:01:14 +00:00
|
|
|
EXPOSE 18080 18081
|
2023-07-30 11:23:14 +00:00
|
|
|
# VOLUME /home/monero/.bitmonero
|