diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4b51653..717aaaf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,6 +8,8 @@ jobs: strategy: matrix: version: + - '22' + - '21' - '20' - '19' - '18' @@ -15,8 +17,6 @@ jobs: - '0.16' - '0.15' - '0.14' - - '0.12' - - '0.12/alpine' fail-fast: false steps: - name: Set up Docker Buildx @@ -63,8 +63,12 @@ jobs: fi fi - if [[ ${DASH_CORE_VERSION} != *"alpine"* ]] && [ $(version ${DASH_CORE_VERSION}) -ge $(version "20") ]; then - PLATFORMS="linux/amd64,linux/arm/v7,linux/arm64" + if [[ ${DASH_CORE_VERSION} != *"alpine"* ]]; then + if [ $(version ${DASH_CORE_VERSION}) -ge $(version "22") ]; then + PLATFORMS="linux/amd64,linux/arm64" + elif [ $(version ${DASH_CORE_VERSION}) -ge $(version "20") ]; then + PLATFORMS="linux/amd64,linux/arm/v7,linux/arm64" + fi fi echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ') diff --git a/0.12/alpine/Dockerfile b/0.12/alpine/Dockerfile deleted file mode 100644 index e259bba..0000000 --- a/0.12/alpine/Dockerfile +++ /dev/null @@ -1,119 +0,0 @@ -# Build stage for BerkeleyDB -FROM alpine as berkeleydb - -RUN apk --no-cache add autoconf -RUN apk --no-cache add automake -RUN apk --no-cache add build-base -RUN apk --no-cache add libressl - -ENV BERKELEYDB_VERSION=db-4.8.30.NC -ENV BERKELEYDB_PREFIX=/opt/${BERKELEYDB_VERSION} - -RUN wget https://download.oracle.com/berkeley-db/${BERKELEYDB_VERSION}.tar.gz -RUN tar -xzf *.tar.gz -RUN sed s/__atomic_compare_exchange/__atomic_compare_exchange_db/g -i ${BERKELEYDB_VERSION}/dbinc/atomic.h -RUN mkdir -p ${BERKELEYDB_PREFIX} - -WORKDIR /${BERKELEYDB_VERSION}/build_unix - -RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX} -RUN make -j4 -RUN make install -RUN rm -rf ${BERKELEYDB_PREFIX}/docs - -# Build stage for Dash -FROM alpine:3.12.1 as dash - -COPY --from=berkeleydb /opt /opt - -RUN apk --no-cache add autoconf -RUN apk --no-cache add automake -RUN apk --no-cache add boost-dev -RUN apk --no-cache add build-base -RUN apk --no-cache add chrpath -RUN apk --no-cache add file -RUN apk --no-cache add gnupg -RUN apk --no-cache add libevent-dev -RUN apk --no-cache add libressl -RUN apk --no-cache add libressl-dev -RUN apk --no-cache add libsodium-dev -RUN apk --no-cache add libtool -RUN apk --no-cache add linux-headers -RUN apk --no-cache add protobuf-dev -RUN apk --no-cache add zeromq-dev - -RUN set -ex \ - && for key in \ - 38EE12EB597B4FC0 \ - ; 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 DASH_VERSION=0.12.2.3 -ENV DASH_PREFIX=/opt/dash-${DASH_VERSION} -ENV DASH_SHASUM="7f7d4429f08c2df8819ae8273402eed67d605e183aee6b02202032b57a136c0b v${DASH_VERSION}.tar.gz" - -RUN wget https://github.com/dashpay/dash/archive/v${DASH_VERSION}.tar.gz -RUN echo "${DASH_SHASUM}" | sha256sum -c -RUN tar -xzf *.tar.gz -RUN ls -la - -WORKDIR /dash-${DASH_VERSION} - -RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac -RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac -RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h -RUN ./autogen.sh -RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \ - --prefix=${DASH_PREFIX} \ - --mandir=/usr/share/man \ - --disable-tests \ - --disable-bench \ - --disable-ccache \ - --with-gui=no \ - --with-utils \ - --with-libs \ - --with-daemon -RUN make -j4 -RUN make install -RUN strip ${DASH_PREFIX}/bin/dash-cli -RUN strip ${DASH_PREFIX}/bin/dash-tx -RUN strip ${DASH_PREFIX}/bin/dashd -RUN strip ${DASH_PREFIX}/lib/libdashconsensus.a -RUN strip ${DASH_PREFIX}/lib/libdashconsensus.so.0.0.0 - -# Build stage for compiled artifacts -FROM alpine - -LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \ - maintainer.1="Pedro Branco (@pedrobranco)" \ - maintainer.2="Rui Marinho (@ruimarinho)" - -RUN adduser -S dash -RUN apk --no-cache add \ - boost \ - boost-program_options \ - curl \ - libevent \ - libressl \ - libzmq \ - su-exec - -ENV DASH_DATA=/home/dash/.dashcore -ENV DASH_VERSION=0.12.2.3 -ENV DASH_PREFIX=/opt/dash-${DASH_VERSION} -ENV PATH=${DASH_PREFIX}/bin:$PATH - -COPY --from=dash /opt /opt -COPY docker-entrypoint.sh /entrypoint.sh - -VOLUME ["/home/dash/.dashcore"] - -EXPOSE 9998 9999 18332 19998 19999 - -ENTRYPOINT ["/entrypoint.sh"] - -CMD ["dashd"] diff --git a/21/Dockerfile b/21/Dockerfile new file mode 100644 index 0000000..fea6cef --- /dev/null +++ b/21/Dockerfile @@ -0,0 +1,55 @@ +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 + +ARG TARGETPLATFORM +ENV DASH_VERSION=21.1.1 +ENV DASH_FOLDER_VERSION=21.1.1 +ENV DASH_DATA=/home/dash/.dashcore \ + PATH=/opt/dashcore-${DASH_FOLDER_VERSION}/bin:$PATH +RUN set -ex \ + && if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \ + && if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \ + && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \ + && 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}-${TARGETPLATFORM}.tar.gz \ + && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz.asc \ + && gpg --verify dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz.asc \ + && tar -xzf dashcore-${DASH_VERSION}-${TARGETPLATFORM}.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/0.12/docker-entrypoint.sh b/21/docker-entrypoint.sh similarity index 100% rename from 0.12/docker-entrypoint.sh rename to 21/docker-entrypoint.sh diff --git a/0.12/Dockerfile b/22/Dockerfile similarity index 65% rename from 0.12/Dockerfile rename to 22/Dockerfile index 071a13d..fae3b8a 100644 --- a/0.12/Dockerfile +++ b/22/Dockerfile @@ -12,7 +12,7 @@ RUN useradd -r dash \ && set -ex \ && for key in \ B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - 4B88269ABD8DF332 \ + 29590362EC878A81FD3C202B52527BEDABE87984 \ ; do \ gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" || \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ @@ -28,15 +28,19 @@ RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/dow && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu -ENV DASH_VERSION=0.12.2.3 -ENV DASH_FOLDER_VERSION=0.12.2 +ARG TARGETPLATFORM +ENV DASH_VERSION=22.0.0 +ENV DASH_FOLDER_VERSION=22.0.0 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}-linux64.tar.gz \ - && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-linux64.tar.gz.asc \ - && gpg --verify dashcore-${DASH_VERSION}-linux64.tar.gz.asc \ - && tar -xzf dashcore-${DASH_VERSION}-linux64.tar.gz -C /opt \ +RUN set -ex \ + && if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \ + && if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \ + && 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}-${TARGETPLATFORM}.tar.gz \ + && curl -SLO https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz.asc \ + && gpg --verify dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz.asc \ + && tar -xzf dashcore-${DASH_VERSION}-${TARGETPLATFORM}.tar.gz -C /opt \ && rm *.tar.gz VOLUME ["/home/dash/.dashcore"] @@ -45,6 +49,6 @@ COPY docker-entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] -EXPOSE 9998 9999 18332 19998 19999 +EXPOSE 9998 9999 19898 19998 19999 CMD ["dashd"] diff --git a/0.12/alpine/docker-entrypoint.sh b/22/docker-entrypoint.sh similarity index 94% rename from 0.12/alpine/docker-entrypoint.sh rename to 22/docker-entrypoint.sh index f88a7b7..8ef60ac 100755 --- a/0.12/alpine/docker-entrypoint.sh +++ b/22/docker-entrypoint.sh @@ -19,7 +19,7 @@ fi if [ "$1" = "dashd" ] || [ "$1" = "dash-cli" ] || [ "$1" = "dash-tx" ]; then echo - exec su-exec dash "$@" + exec gosu dash "$@" fi echo diff --git a/README.md b/README.md index 046e88b..4b5d7af 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ A Dash Core docker image. ## Tags -- `20.0.4`, `20.0`, `20`, `latest` ([20/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/20/Dockerfile)) +- `22.0.0`, `22.0`, `22`, `latest` ([22/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/22/Dockerfile)) +- `21.1.1`, `21.0`, `21`, `latest` ([21/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/21/Dockerfile)) +- `20.0.4`, `20.0`, `20` ([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)) @@ -14,8 +16,6 @@ A Dash Core docker image. - `0.15.0.0`, `0.15` ([0.15/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.15/Dockerfile)) - `0.14.0.5-alpine`, `0.14-alpine`, `alpine` ([0.14/alpine/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.14/alpine/Dockerfile)) - `0.14.0.5`, `0.14` ([0.14/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.14/Dockerfile)) -- `0.12.2.3-alpine`, `0.12-alpine` ([0.12/alpine/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.12/alpine/Dockerfile)) -- `0.12.2.3`, `0.12` ([0.12/Dockerfile](https://github.com/uphold/docker-dash-core/blob/master/0.12/Dockerfile)) ## What is Dash? _from [dashwiki](https://github.com/dashpay/dash/wiki)_