@@ -8,21 +8,40 @@ WORKDIR /opt
8
8
RUN apt-get update && \
9
9
apt-get dist-upgrade -y && \
10
10
apt-get install -y \
11
- wget ca-certificates bzip2
11
+ wget ca-certificates bzip2 gnupg git
12
12
13
13
ARG MONERO_VERSION=v0.18.3.4
14
14
WORKDIR /opt/monero
15
- RUN case "$(uname -m)" in \
16
- x86_64) ARCH="x64" ; SHA256SUM="51ba03928d189c1c11b5379cab17dd9ae8d2230056dc05c872d0f8dba4a87f1d" ;; \
17
- aarch64* | arm64 | armv8*) ARCH="armv8" ; SHA256SUM="33ca2f0055529d225b61314c56370e35606b40edad61c91c859f873ed67a1ea7" ;; \
18
- armv7*) ARCH="armv7" ; SHA256SUM="354603c56446fb0551cdd6933bce5a13590b7881e05979b7ec25d89e7e59a0e2" ;; \
15
+
16
+ RUN git clone --filter=blob:none --sparse https://github.com/monero-project/monero -b ${MONERO_VERSION} && \
17
+ cd monero && \
18
+ git sparse-checkout set utils/gpg_keys && \
19
+ mkdir -p /root/.gnupg && \
20
+ chmod 700 /root/.gnupg && \
21
+ for key in utils/gpg_keys/*.asc; do \
22
+ gpg --import "$key" ; \
23
+ done && \
24
+ cd .. && \
25
+ rm -rf monero
26
+
27
+ RUN wget -q -O hashes.txt https://www.getmonero.org/downloads/hashes.txt && \
28
+ wget -q -O hashes.txt.sig https://www.getmonero.org/downloads/hashes.txt.sig && \
29
+ gpg --verify hashes.txt.sig hashes.txt && \
30
+ case "$(uname -m)" in \
31
+ x86_64) ARCH="x64" ;; \
32
+ aarch64* | arm64 | armv8*) ARCH="armv8" ;; \
33
+ armv7*) ARCH="armv7" ;; \
19
34
*) echo "Unexpected architecture: $(uname -m)" && exit 1;; \
20
- esac \
21
- \
22
- && wget https://downloads.getmonero.org/cli/monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 \
23
- && echo "${SHA256SUM} monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2" | sha256sum -c \
24
- && tar -xjvf monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 --strip-components 1 \
25
- && rm -f monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2
35
+ esac && \
36
+ MONERO_HASH=$(grep "monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2" hashes.txt | cut -d' ' -f1) && \
37
+ if [ -z "$MONERO_HASH" ]; then \
38
+ echo "Hash not found for architecture ${ARCH} and version ${MONERO_VERSION}" && \
39
+ exit 1; \
40
+ fi && \
41
+ wget https://downloads.getmonero.org/cli/monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 && \
42
+ echo "${MONERO_HASH} monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2" | sha256sum -c && \
43
+ tar -xjf monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 --strip-components 1 && \
44
+ rm -f monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 hashes.txt hashes.txt.sig
26
45
27
46
# #################
28
47
# --- runner --- #
0 commit comments