Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion services/pivx/config/pivx.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ rpcpassword={{or "PIVX_RPCPORT" ""}}
rpcallowip={{or .PIVX_RPCALLOWIP "0.0.0.0/0"}}
testnet={{or .PIVX_TESTNET 0}}
regtest={{or .PIVX_REGTEST 0}}
walletnotify={{or .PIVX_WALLETNOTIFY ""}}
walletnotify={{or .PIVX_WALLETNOTIFY ""}}

#####################
# Masternode Settings
#####################

externalip={{or .PIVX_EXTERNALIP ""}}
masternode={{or .PIVX_MASTERNODE 0}}
masternodeprivkey={{or .PIVX_MASTERNODEPRIVKEY ""}}
2 changes: 1 addition & 1 deletion services/pivx/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
pivx:
image: crypdex/pivx:${PIVX_VERSION:-3.2}
image: crypdex/pivx:${PIVX_VERSION:-3.3}
restart: on-failure
ports:
- 51472:51472
Expand Down
70 changes: 70 additions & 0 deletions services/pivx/docker/3.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# WARNING: Litecoin does not work well on Alpine yet - missing some libs
# https://github.com/litecoin-project/litecoin/issues/407

# Base image default is x86:
# arm64v8/debian:stable-slim | debian:stable-slim
ARG IMAGE=debian:stable-slim

FROM ${IMAGE} as builder

LABEL maintainer.0="David Michael <david@crypdex.io>"


ARG ARCH
RUN test -n "$ARCH"
ARG VERSION=$VERSION
RUN test -n "$VERSION"



#ENV VERSION=3.2.2
# x86_64 || aarch64
ARG USER=pivx

RUN useradd -r $USER \
&& apt-get update -y \
&& apt-get install -y git build-essential gnupg unzip wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /tmp

# download source
RUN wget -O /tmp/pivx-"${VERSION}"-${ARCH}-linux-gnu.tar.gz \
"https://github.com/PIVX-Project/PIVX/releases/download/v"${VERSION}"/pivx-"${VERSION}"-${ARCH}-linux-gnu.tar.gz" \
&& wget -O /tmp/SHA256SUMS.asc "https://github.com/PIVX-Project/PIVX/releases/download/v"${VERSION}"/SHA256SUMS.asc"

# VERIFY
# Importing keys from a keyserver takes a loooong time.
COPY fuzzbawls-key.gpg.key fuzzbawls-key.gpg.key
# verify gpg signature
RUN gpg --import fuzzbawls-key.gpg.key && gpg --fingerprint 3BDCDA2D87A881D9 && gpg --verify SHA256SUMS.asc


# extract binaries
RUN mkdir pivx-$VERSION \
&& tar xzpvf pivx-$VERSION-${ARCH}-linux-gnu.tar.gz -C pivx-$VERSION --strip-components 1\
&& cd pivx-$VERSION \
&& cp bin/* /usr/local/bin/ \
&& cd ~ \
&& rm -rf /tmp/pivx-$VERSION

#install su-exec
RUN git clone https://github.com/ncopa/su-exec.git \
&& cd su-exec && make && cp su-exec /usr/local/bin/ \
&& cd .. && rm -rf su-exec

# RUN [ "cross-build-end" ]
RUN apt-get update && apt-get install -y curl && apt-get clean

COPY entrypoint.sh /entrypoint.sh

RUN ["chmod", "+x", "/entrypoint.sh"]

VOLUME ["/home/pivx/.pivx"]

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 51473 51472

CMD ["pivxd"]
29 changes: 29 additions & 0 deletions services/pivx/docker/3.3/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
set -e

datadir="/home/pivx/.pivx"

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

set -- pivxd "$@"
fi

if [[ $(echo "$1" | cut -c1) = "-" ]] || [[ "$1" = "pivxd" ]]; then
echo "Creating data directory ..."
mkdir -p "$datadir"
chmod 700 "$datadir"
chown -R pivx "$datadir"

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

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

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

echo
exec "$@"
Loading