76 lines
2.3 KiB
Docker
76 lines
2.3 KiB
Docker
FROM peerplays/ubuntu-build:20.04 AS deps
|
|
LABEL Peerplays Blockchain Standards Association
|
|
RUN groupadd peerplays && \
|
|
useradd -rm -d /home/peerplays -s /bin/bash -g peerplays -u 1000 peerplays
|
|
|
|
WORKDIR /home/peerplays/
|
|
|
|
#===============================================================================
|
|
# libzmq setup
|
|
#===============================================================================
|
|
RUN \
|
|
wget https://github.com/zeromq/libzmq/archive/refs/tags/v4.3.4.zip && \
|
|
unzip v4.3.4.zip && \
|
|
cd libzmq-4.3.4 && \
|
|
mkdir build && \
|
|
cd build && \
|
|
cmake .. && \
|
|
make -j$(nproc) install && \
|
|
ldconfig
|
|
#===============================================================================
|
|
# cppzmq setup
|
|
#===============================================================================
|
|
RUN \
|
|
wget https://github.com/zeromq/cppzmq/archive/refs/tags/v4.8.1.zip && \
|
|
unzip v4.8.1.zip && \
|
|
cd cppzmq-4.8.1 && \
|
|
mkdir build && \
|
|
cd build && \
|
|
cmake .. && \
|
|
make -j$(nproc) install && \
|
|
ldconfig
|
|
|
|
#===============================================================================
|
|
# Peerplays setup
|
|
#===============================================================================
|
|
|
|
# Add local source
|
|
ADD . peerplays
|
|
|
|
# Configure and build Peerplays
|
|
RUN \
|
|
cd peerplays && \
|
|
git submodule update --init --recursive && \
|
|
mkdir build && \
|
|
cd build && \
|
|
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
|
make -j$(nproc) cli_wallet witness_node && \
|
|
chown -R peerplays:peerplays /home/peerplays/
|
|
|
|
# Fresh image for running compiled binaries
|
|
FROM ubuntu:20.04
|
|
|
|
RUN apt update -y && \
|
|
DEBIAN_FRONTEND=noninteractive apt install -y \
|
|
curl \
|
|
libzmq5 && \
|
|
groupadd peerplays && \
|
|
useradd -rm -d /home/peerplays -s /bin/bash -g peerplays -u 1000 peerplays && \
|
|
chown -R peerplays:peerplays /home/peerplays/
|
|
|
|
USER peerplays
|
|
|
|
WORKDIR /home/peerplays/
|
|
|
|
# Copying the build artifacts from the above ubuntu-build image
|
|
COPY --from=deps /home/peerplays/peerplays/build/programs/witness_node/witness_node .
|
|
COPY --from=deps /home/peerplays/peerplays/build/programs/cli_wallet/cli_wallet .
|
|
COPY --from=deps /home/peerplays/peerplays/genesis-mainet.json .
|
|
|
|
# Peerplays RPC
|
|
EXPOSE 8090
|
|
# Peerplays P2P:
|
|
EXPOSE 9777
|
|
|
|
# Peerplays
|
|
CMD ["./witness_node", "-d", "./witness_node_data_dir"]
|