From c36cfda07f59e9cc8c899c04f970446eda75a063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Fonseca?= Date: Thu, 30 Nov 2023 16:49:02 +0000 Subject: [PATCH] Add support for dashcore@20.0.1 --- .github/workflows/build.yaml | 1 + 20/Dockerfile | 50 ++++++++++++++++++++++++++++++++++++ 20/docker-entrypoint.sh | 26 +++++++++++++++++++ README.md | 3 ++- 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 20/Dockerfile create mode 100755 20/docker-entrypoint.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 71f2172..861898f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,6 +8,7 @@ jobs: strategy: matrix: version: + - '20' - '19' - '18' - '0.17' diff --git a/20/Dockerfile b/20/Dockerfile new file mode 100644 index 0000000..d27a140 --- /dev/null +++ b/20/Dockerfile @@ -0,0 +1,50 @@ +FROM debian:stable-slim + +LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \ + maintainer.1="Pedro Branco (@pedrobranco)" \ + maintainer.2="Rui Marinho (@ruimarinho)" + +RUN useradd -r dash \ + && apt-get update -y \ + && apt-get install -y curl gnupg unzip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && set -ex \ + && for key in \ + B42F6819007F00F88E364FD4036A9C25BF357DD4 \ + 29590362EC878A81FD3C202B52527BEDABE87984 \ + ; do \ + gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ + gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ + gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ + gpg --keyserver keys.openpgp.org --recv-keys "$key" ; \ + done + +ENV GOSU_VERSION=1.10 + +RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \ + && curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ + && chmod +x /usr/local/bin/gosu + +ENV DASH_VERSION=20.0.1 +ENV DASH_FOLDER_VERSION=20.0.1 +ENV DASH_DATA=/home/dash/.dashcore \ + PATH=/opt/dashcore-${DASH_FOLDER_VERSION}/bin:$PATH +RUN curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/SHA256SUMS.asc \ + && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz \ + && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz.asc \ + && gpg --verify dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz.asc \ + && tar -xzf dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz -C /opt \ + && rm *.tar.gz + +VOLUME ["/home/dash/.dashcore"] + +COPY docker-entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + +EXPOSE 9998 9999 19898 19998 19999 + +CMD ["dashd"] diff --git a/20/docker-entrypoint.sh b/20/docker-entrypoint.sh new file mode 100755 index 0000000..8ef60ac --- /dev/null +++ b/20/docker-entrypoint.sh @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +if [ $(echo "$1" | cut -c1) = "-" ]; then + echo "$0: assuming arguments for dashd" + + set -- dashd "$@" +fi + +if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "dashd" ]; then + mkdir -p "$DASH_DATA" + chmod 700 "$DASH_DATA" + chown -R dash "$DASH_DATA" + + echo "$0: setting data directory to $DASH_DATA" + + set -- "$@" -datadir="$DASH_DATA" +fi + +if [ "$1" = "dashd" ] || [ "$1" = "dash-cli" ] || [ "$1" = "dash-tx" ]; then + echo + exec gosu dash "$@" +fi + +echo +exec "$@" diff --git a/README.md b/README.md index d3b0f35..d92fa0a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ A Dash Core docker image. ## Tags -- `19.2.0`, `19.2`, `19`, `latest` ([19/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/19/Dockerfile)) +- `20.0.1`, `20.0`, `20`, `latest` ([20/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/20/Dockerfile)) +- `19.2.0`, `19.2`, `19` ([19/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/19/Dockerfile)) - `18.0.1`, `18.0`, `18` ([18/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/18/Dockerfile)) - `0.17.0.3`, `0.17` ([0.17/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.17/Dockerfile)) - `0.16.0.1`, `0.16` ([0.16/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.16/Dockerfile))