diff --git a/Groestlcoin/23.0/docker-entrypoint.sh b/Groestlcoin/23.0/docker-entrypoint.sh index c20f0c3..20ef0e6 100755 --- a/Groestlcoin/23.0/docker-entrypoint.sh +++ b/Groestlcoin/23.0/docker-entrypoint.sh @@ -27,7 +27,7 @@ if [[ "$1" == "groestlcoin-cli" || "$1" == "groestlcoin-tx" || "$1" == "groestlc CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}" if ! [[ -f "${WALLETFILE}" ]]; then echo "The wallet does not exists, creating it at ${WALLETDIR}..." - gosu groestlcoin groestlcoin-wallet "-datadir=${WALLETDIR}" "-wallet=" create + gosu groestlcoin groestlcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create fi fi diff --git a/Groestlcoin/24.0.1/docker-entrypoint.sh b/Groestlcoin/24.0.1/docker-entrypoint.sh index c20f0c3..54b113f 100644 --- a/Groestlcoin/24.0.1/docker-entrypoint.sh +++ b/Groestlcoin/24.0.1/docker-entrypoint.sh @@ -25,9 +25,10 @@ if [[ "$1" == "groestlcoin-cli" || "$1" == "groestlcoin-tx" || "$1" == "groestlc mkdir -p "$WALLETDIR" chown -R groestlcoin:groestlcoin "$WALLETDIR" CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}" - if ! [[ -f "${WALLETFILE}" ]]; then + : "${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}" "-wallet=" create + gosu groestlcoin groestlcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create fi fi @@ -59,6 +60,7 @@ if [[ "$1" == "groestlcoin-cli" || "$1" == "groestlcoin-tx" || "$1" == "groestlc 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 "$@" diff --git a/Groestlcoin/24.0.1/linuxamd64.Dockerfile b/Groestlcoin/24.0.1/linuxamd64.Dockerfile index 446b0cf..e303797 100644 --- a/Groestlcoin/24.0.1/linuxamd64.Dockerfile +++ b/Groestlcoin/24.0.1/linuxamd64.Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-slim as builder +FROM debian:bullseye-slim as builder RUN set -ex \ && apt-get update \ @@ -20,9 +20,12 @@ RUN set -ex \ && wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \ && echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c - -FROM debian:buster-slim +FROM debian:bullseye-slim COPY --from=builder "/tmp/bin" /usr/local/bin +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 # create data directory diff --git a/Groestlcoin/24.0.1/linuxarm32v7.Dockerfile b/Groestlcoin/24.0.1/linuxarm32v7.Dockerfile index 536cb83..11a1b04 100644 --- a/Groestlcoin/24.0.1/linuxarm32v7.Dockerfile +++ b/Groestlcoin/24.0.1/linuxarm32v7.Dockerfile @@ -1,5 +1,5 @@ # Use manifest image which support all architecture -FROM debian:buster-slim as builder +FROM debian:bullseye-slim as builder RUN set -ex \ && apt-get update \ @@ -23,11 +23,14 @@ RUN set -ex \ && echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c - # Making sure the builder build an arm image despite being x64 -FROM arm32v7/debian:buster-slim +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 +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 # create data directory diff --git a/Groestlcoin/24.0.1/linuxarm64v8.Dockerfile b/Groestlcoin/24.0.1/linuxarm64v8.Dockerfile index 8960560..8374d6b 100644 --- a/Groestlcoin/24.0.1/linuxarm64v8.Dockerfile +++ b/Groestlcoin/24.0.1/linuxarm64v8.Dockerfile @@ -1,5 +1,5 @@ # Use manifest image which support all architecture -FROM debian:buster-slim as builder +FROM debian:bullseye-slim as builder RUN set -ex \ && apt-get update \ @@ -23,11 +23,14 @@ RUN set -ex \ && echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c - # Making sure the builder build an arm image despite being x64 -FROM arm64v8/debian:buster-slim +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 +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 # create data directory diff --git a/Groestlcoin/25.0/docker-entrypoint.sh b/Groestlcoin/25.0/docker-entrypoint.sh new file mode 100755 index 0000000..54b113f --- /dev/null +++ b/Groestlcoin/25.0/docker-entrypoint.sh @@ -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 diff --git a/Groestlcoin/25.0/linuxamd64.Dockerfile b/Groestlcoin/25.0/linuxamd64.Dockerfile new file mode 100644 index 0000000..1561e37 --- /dev/null +++ b/Groestlcoin/25.0/linuxamd64.Dockerfile @@ -0,0 +1,44 @@ +FROM debian:bullseye-slim as builder + +RUN set -ex \ + && apt-get update \ + && apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget + +ENV GROESTLCOIN_VERSION 25.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 bcca36b5a2f1e83a4fd9888bc0016d3f46f9ef01238dc23a8e03f2f4ac3b9707 + +# 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.11/gosu-amd64" \ + && echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c - + +FROM debian:bullseye-slim +COPY --from=builder "/tmp/bin" /usr/local/bin + +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 + +# 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"] diff --git a/Groestlcoin/25.0/linuxarm32v7.Dockerfile b/Groestlcoin/25.0/linuxarm32v7.Dockerfile new file mode 100644 index 0000000..09aa78c --- /dev/null +++ b/Groestlcoin/25.0/linuxarm32v7.Dockerfile @@ -0,0 +1,49 @@ +# Use manifest image which support all architecture +FROM debian:bullseye-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 25.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 4e984db13cd6e8294e0b868b3937e7d4eb24464eac371d2978a8338f3f80c16f + +# 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.11/gosu-armhf" \ + && echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c - + +# Making sure the builder build an arm image despite being x64 +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 + +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 + +# 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"] diff --git a/Groestlcoin/25.0/linuxarm64v8.Dockerfile b/Groestlcoin/25.0/linuxarm64v8.Dockerfile new file mode 100644 index 0000000..8f651d3 --- /dev/null +++ b/Groestlcoin/25.0/linuxarm64v8.Dockerfile @@ -0,0 +1,49 @@ +# Use manifest image which support all architecture +FROM debian:bullseye-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 25.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 d8776b405113b46d6be6e4921c5a5e62cbfaa5329087abbec14cc24d750f9c94 + +# 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.11/gosu-arm64" \ + && echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c - + +# Making sure the builder build an arm image despite being x64 +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 + +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 + +# 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"]