Skip to content

Commit

Permalink
Bump to 27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Apr 23, 2024
1 parent 0f094f8 commit 280bf37
Show file tree
Hide file tree
Showing 6 changed files with 261 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
strategy:
matrix:
version:
- '27'
- '27/alpine'
- '26'
- '26/alpine'
- '25'
Expand Down
53 changes: 53 additions & 0 deletions 27/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM debian:bullseye-slim

ARG UID=101
ARG GID=101

LABEL maintainer="Groestlcoin developers <[email protected]>"

RUN groupadd --gid ${GID} groestlcoin \
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} groestlcoin \
&& apt-get update -y \
&& apt-get install -y curl gnupg gosu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ARG TARGETPLATFORM
ENV GROESTLCOIN_VERSION=27.0
ENV GROESTLCOIN_DATA=/home/groestlcoin/.groestlcoin
ENV PATH=/opt/groestlcoin-${GROESTLCOIN_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 \
&& for key in \
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done \
&& curl -SLO https://github.com/Groestlcoin/groestlcoin/releases/download/v${GROESTLCOIN_VERSION}/groestlcoin-${GROESTLCOIN_VERSION}-${TARGETPLATFORM}.tar.gz \
&& curl -SLO https://github.com/Groestlcoin/groestlcoin/releases/download/v${GROESTLCOIN_VERSION}/SHA256SUMS \
&& curl -SLO https://github.com/Groestlcoin/groestlcoin/releases/download/v${GROESTLCOIN_VERSION}/SHA256SUMS.asc \
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
&& grep " groestlcoin-${GROESTLCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" SHA256SUMS | sha256sum -c - \
&& tar -xzf *.tar.gz -C /opt \
&& rm *.tar.gz *.asc \
&& rm -rf /opt/groestlcoin-${GROESTLCOIN_VERSION}/bin/groestlcoin-qt

COPY docker-entrypoint.sh /entrypoint.sh

VOLUME ["/home/groestlcoin/.groestlcoin"]

EXPOSE 1441 1331 17766 17777 18443 18888 31331 31441

ENTRYPOINT ["/entrypoint.sh"]

RUN groestlcoind -version | grep "Groestlcoin Core version v${GROESTLCOIN_VERSION}"

CMD ["groestlcoind"]
124 changes: 124 additions & 0 deletions 27/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Build stage for BerkeleyDB
FROM alpine as berkeleydb

RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
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-5.3.28.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}/src/dbinc/atomic.h
RUN sed s/atomic_init/atomic_init_db/g -i ${BERKELEYDB_VERSION}/src/dbinc/atomic.h ${BERKELEYDB_VERSION}/src/mp/mp_region.c ${BERKELEYDB_VERSION}/src/mp/mp_mvcc.c ${BERKELEYDB_VERSION}/src/mp/mp_fget.c ${BERKELEYDB_VERSION}/src/mutex/mut_method.c ${BERKELEYDB_VERSION}/src/mutex/mut_tas.c
RUN sed s/WinIoCtl.h/winioctl.h/g -i ${BERKELEYDB_VERSION}/src/dbinc/win_db.h
RUN mkdir -p ${BERKELEYDB_PREFIX}

WORKDIR /${BERKELEYDB_VERSION}/build_unix

RUN ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${BERKELEYDB_PREFIX} --build=aarch64-unknown-linux-gnu
RUN make -j4
RUN make install
RUN rm -rf ${BERKELEYDB_PREFIX}/docs

# Build stage for Groestlcoin Core
FROM alpine as groestlcoin-core

COPY --from=berkeleydb /opt /opt

RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
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 libtool
RUN apk --no-cache add linux-headers
RUN apk --no-cache add sqlite-dev
RUN apk --no-cache add zeromq-dev
RUN set -ex \
&& for key in \
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
done

ENV GROESTLCOIN_VERSION=27.0
ENV GROESTLCOIN_PREFIX=/opt/groestlcoin-${GROESTLCOIN_VERSION}

RUN wget https://github.com/Groestlcoin/groestlcoin/releases/download/v${GROESTLCOIN_VERSION}/SHA256SUMS
RUN wget https://github.com/Groestlcoin/groestlcoin/releases/download/v${GROESTLCOIN_VERSION}/SHA256SUMS.asc
RUN wget https://github.com/Groestlcoin/groestlcoin/releases/download/v${GROESTLCOIN_VERSION}/groestlcoin-${GROESTLCOIN_VERSION}.tar.gz
RUN gpg --verify SHA256SUMS.asc SHA256SUMS
RUN grep " groestlcoin-${GROESTLCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
RUN tar -xzf *.tar.gz

WORKDIR /groestlcoin-${GROESTLCOIN_VERSION}

RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat/compat.h
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
--prefix=${GROESTLCOIN_PREFIX} \
--mandir=/usr/share/man \
--disable-tests \
--disable-bench \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-sqlite=yes \
--with-daemon
RUN make -j4
RUN make install
RUN strip ${GROESTLCOIN_PREFIX}/bin/groestlcoin-cli
RUN strip ${GROESTLCOIN_PREFIX}/bin/groestlcoin-tx
RUN strip ${GROESTLCOIN_PREFIX}/bin/groestlcoind
RUN strip ${GROESTLCOIN_PREFIX}/lib/libgroestlcoinconsensus.a
RUN strip ${GROESTLCOIN_PREFIX}/lib/libgroestlcoinconsensus.so.0.0.0

# Build stage for compiled artifacts
FROM alpine

ARG UID=100
ARG GID=101

LABEL maintainer="Groestlcoin developers <[email protected]>"

RUN addgroup groestlcoin --gid ${GID} --system
RUN adduser --uid ${UID} --system groestlcoin --ingroup groestlcoin
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add \
libevent \
libzmq \
shadow \
sqlite-dev \
su-exec

ENV GROESTLCOIN_DATA=/home/groestlcoin/.groestlcoin
ENV GROESTLCOIN_VERSION=27.0
ENV GROESTLCOIN_PREFIX=/opt/groestlcoin-${GROESTLCOIN_VERSION}
ENV PATH=${GROESTLCOIN_PREFIX}/bin:$PATH

COPY --from=groestlcoin-core /opt /opt
COPY docker-entrypoint.sh /entrypoint.sh

VOLUME ["/home/groestlcoin/.groestlcoin"]

EXPOSE 1441 1331 17766 17777 18443 18888 31331 31441

ENTRYPOINT ["/entrypoint.sh"]

RUN groestlcoind -version | grep "Groestlcoin Core version v${GROESTLCOIN_VERSION}"

CMD ["groestlcoind"]
39 changes: 39 additions & 0 deletions 27/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
set -e

if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
usermod -u "$UID" groestlcoin
fi

if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
groupmod -g "$GID" groestlcoin
fi

echo "$0: assuming uid:gid for groestlcoin:groestlcoin of $(id -u groestlcoin):$(id -g groestlcoin)"

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for groestlcoind"

set -- groestlcoind "$@"
fi

if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "groestlcoind" ]; then
mkdir -p "$GROESTLCOIN_DATA"
chmod 700 "$GROESTLCOIN_DATA"
# Fix permissions for home dir.
chown -R groestlcoin:groestlcoin "$(getent passwd groestlcoin | cut -d: -f6)"
# Fix permissions for groestlcoin data dir.
chown -R groestlcoin:groestlcoin "$GROESTLCOIN_DATA"

echo "$0: setting data directory to $GROESTLCOIN_DATA"

set -- "$@" -datadir="$GROESTLCOIN_DATA"
fi

if [ "$1" = "groestlcoind" ] || [ "$1" = "groestlcoin-cli" ] || [ "$1" = "groestlcoin-tx" ]; then
echo
exec su-exec groestlcoin "$@"
fi

echo
exec "$@"
39 changes: 39 additions & 0 deletions 27/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -e

if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
usermod -u "$UID" groestlcoin
fi

if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
groupmod -g "$GID" groestlcoin
fi

echo "$0: assuming uid:gid for groestlcoin:groestlcoin of $(id -u groestlcoin):$(id -g groestlcoin)"

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for groestlcoind"

set -- groestlcoind "$@"
fi

if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "groestlcoind" ]; then
mkdir -p "$GROESTLCOIN_DATA"
chmod 700 "$GROESTLCOIN_DATA"
# Fix permissions for home dir.
chown -R groestlcoin:groestlcoin "$(getent passwd groestlcoin | cut -d: -f6)"
# Fix permissions for groestlcoin data dir.
chown -R groestlcoin:groestlcoin "$GROESTLCOIN_DATA"

echo "$0: setting data directory to $GROESTLCOIN_DATA"

set -- "$@" -datadir="$GROESTLCOIN_DATA"
fi

if [ "$1" = "groestlcoind" ] || [ "$1" = "groestlcoin-cli" ] || [ "$1" = "groestlcoin-tx" ]; then
echo
exec gosu groestlcoin "$@"
fi

echo
exec "$@"
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ A groestlcoin-core docker image with support for the following platforms:

## Tags

- `26`, `latest` ([26/Dockerfile](https://github.com/groestlcoin/docker-groestlcoin-core/blob/master/26/Dockerfile)) [**multi-arch**]
- `27`, `latest` ([27/Dockerfile](https://github.com/groestlcoin/docker-groestlcoin-core/blob/master/27/Dockerfile)) [**multi-arch**]
- `27-alpine` ([27/alpine/Dockerfile](https://github.com/groestlcoin/docker-groestlcoin-core/blob/master/27/alpine/Dockerfile))

- `26` ([26/Dockerfile](https://github.com/groestlcoin/docker-groestlcoin-core/blob/master/26/Dockerfile)) [**multi-arch**]
- `26-alpine` ([26/alpine/Dockerfile](https://github.com/groestlcoin/docker-groestlcoin-core/blob/master/26/alpine/Dockerfile))

- `25` ([25/Dockerfile](https://github.com/groestlcoin/docker-groestlcoin-core/blob/master/25/Dockerfile)) [**multi-arch**]
Expand Down

0 comments on commit 280bf37

Please sign in to comment.