Add Groestlcoin Core 26.0 (#75)

This commit is contained in:
gruve-p 2024-06-14 08:50:28 +02:00 committed by GitHub
parent 1867c330e1
commit ae3f9cff0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 230 additions and 3 deletions

View File

@ -23,10 +23,13 @@ RUN set -ex \
FROM debian:bullseye-slim
COPY --from=builder "/tmp/bin" /usr/local/bin
ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999
RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r groestlcoin && useradd -r -m -g groestlcoin groestlcoin
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin
# create data directory
ENV GROESTLCOIN_DATA /data

View File

@ -28,10 +28,13 @@ FROM arm32v7/debian:bullseye-slim
COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999
RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r groestlcoin && useradd -r -m -g groestlcoin groestlcoin
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin
# create data directory
ENV GROESTLCOIN_DATA /data

View File

@ -28,10 +28,13 @@ FROM arm64v8/debian:bullseye-slim
COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999
RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r groestlcoin && useradd -r -m -g groestlcoin groestlcoin
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin
# create data directory
ENV GROESTLCOIN_DATA /data

View File

@ -0,0 +1,67 @@
#!/bin/bash
set -e
if [[ "$1" == "groestlcoin-cli" || "$1" == "groestlcoin-tx" || "$1" == "groestlcoind" || "$1" == "test_groestlcoin" ]]; then
mkdir -p "$GROESTLCOIN_DATA"
CONFIG_PREFIX=""
if [[ "${GROESTLCOIN_NETWORK}" == "regtest" ]]; then
CONFIG_PREFIX=$'regtest=1\n[regtest]'
elif [[ "${GROESTLCOIN_NETWORK}" == "testnet" ]]; then
CONFIG_PREFIX=$'testnet=1\n[test]'
elif [[ "${GROESTLCOIN_NETWORK}" == "mainnet" ]]; then
CONFIG_PREFIX=$'mainnet=1\n[main]'
elif [[ "${GROESTLCOIN_NETWORK}" == "signet" ]]; then
CONFIG_PREFIX=$'signet=1\n[signet]'
else
GROESTLCOIN_NETWORK="mainnet"
CONFIG_PREFIX=$'mainnet=1\n[main]'
fi
if [[ "$GROESTLCOIN_WALLETDIR" ]] && [[ "$GROESTLCOIN_NETWORK" ]]; then
NL=$'\n'
WALLETDIR="$GROESTLCOIN_WALLETDIR/${GROESTLCOIN_NETWORK}"
WALLETFILE="${WALLETDIR}/wallet.dat"
mkdir -p "$WALLETDIR"
chown -R groestlcoin:groestlcoin "$WALLETDIR"
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
: "${CREATE_WALLET:=true}"
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
gosu groestlcoin groestlcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
fi
fi
cat <<-EOF > "$GROESTLCOIN_DATA/groestlcoin.conf"
${CONFIG_PREFIX}
printtoconsole=1
rpcallowip=::/0
${GROESTLCOIN_EXTRA_ARGS}
EOF
chown groestlcoin:groestlcoin "$GROESTLCOIN_DATA/groestlcoin.conf"
if [[ "${GROESTLCOIN_TORCONTROL}" ]]; then
# Because groestlcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
TOR_CONTROL_HOST=$(echo ${GROESTLCOIN_TORCONTROL} | cut -d ':' -f 1)
TOR_CONTROL_PORT=$(echo ${GROESTLCOIN_TORCONTROL} | cut -d ':' -f 2)
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$GROESTLCOIN_DATA/groestlcoin.conf"
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $GROESTLCOIN_DATA/groestlcoin.conf"
else
echo "Invalid GROESTLCOIN_TORCONTROL"
fi
fi
# ensure correct ownership and linking of data directory
# we do not update group ownership here, in case users want to mount
# a host directory and still retain access to it
chown -R groestlcoin "$GROESTLCOIN_DATA"
ln -sfn "$GROESTLCOIN_DATA" /home/groestlcoin/.groestlcoin
chown -h groestlcoin:groestlcoin /home/groestlcoin/.groestlcoin
rm -f /home/groestlcoin/.groestlcoin/settings.json
exec gosu groestlcoin "$@"
else
exec "$@"
fi

View File

@ -0,0 +1,47 @@
FROM debian:bookworm-slim as builder
RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
ENV GROESTLCOIN_VERSION 26.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-x86_64-linux-gnu.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 0e24be6c094c1d7ae75d9d99b9bfb067e75200ed43fd8fde94d307a6bbd8bd72
# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
FROM debian:bookworm-slim
COPY --from=builder "/tmp/bin" /usr/local/bin
ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999
RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin
# create data directory
ENV GROESTLCOIN_DATA /data
RUN mkdir "$GROESTLCOIN_DATA" \
&& chown -R groestlcoin:groestlcoin "$GROESTLCOIN_DATA" \
&& ln -sfn "$GROESTLCOIN_DATA" /home/groestlcoin/.groestlcoin \
&& chown -h groestlcoin:groestlcoin /home/groestlcoin/.groestlcoin
VOLUME /data
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]

View File

@ -0,0 +1,52 @@
# Use manifest image which support all architecture
FROM debian:bookworm-slim as builder
RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
ENV GROESTLCOIN_VERSION 26.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 882d3dd86f33908180557522c55bcee5b1969ecc9e34f8c3b907630c0c00cea5
# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
# Making sure the builder build an arm image despite being x64
FROM arm32v7/debian:bookworm-slim
COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999
RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin
# create data directory
ENV GROESTLCOIN_DATA /data
RUN mkdir "$GROESTLCOIN_DATA" \
&& chown -R groestlcoin:groestlcoin "$GROESTLCOIN_DATA" \
&& ln -sfn "$GROESTLCOIN_DATA" /home/groestlcoin/.groestlcoin \
&& chown -h groestlcoin:groestlcoin /home/groestlcoin/.groestlcoin
VOLUME /data
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]

View File

@ -0,0 +1,52 @@
# Use manifest image which support all architecture
FROM debian:bookworm-slim as builder
RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
ENV GROESTLCOIN_VERSION 26.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-aarch64-linux-gnu.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 69c4f39699efe7a6c112aa2570ad061e90ff1a0128d07df318d2f2df29083dff
# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
# Making sure the builder build an arm image despite being x64
FROM arm64v8/debian:bookworm-slim
COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999
RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin
# create data directory
ENV GROESTLCOIN_DATA /data
RUN mkdir "$GROESTLCOIN_DATA" \
&& chown -R groestlcoin:groestlcoin "$GROESTLCOIN_DATA" \
&& ln -sfn "$GROESTLCOIN_DATA" /home/groestlcoin/.groestlcoin \
&& chown -h groestlcoin:groestlcoin /home/groestlcoin/.groestlcoin
VOLUME /data
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]