Dockerfile
This commit is contained in:
@@ -1,70 +1,96 @@
|
||||
# syntax=docker/dockerfile:3
|
||||
|
||||
## BitDeals Module Dockerfile
|
||||
|
||||
## the Module user
|
||||
ARG UNAME="module"
|
||||
ARG UHOME="/home/$UNAME"
|
||||
|
||||
## Base image
|
||||
FROM debian:bullseye
|
||||
FROM debian:bullseye AS updated-debian
|
||||
|
||||
SHELL ["/bin/bash", "-exo", "pipefail", "-c"]
|
||||
|
||||
LABEL name="BitDeals Module"
|
||||
EXPOSE 4977/tcp 80/tcp
|
||||
EXPOSE 4999 80
|
||||
|
||||
## Debian update; install dependencies for GPG
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update ; \
|
||||
apt-get upgrade -y ; \
|
||||
apt-get -y install --no-install-recommends gpg gpg-agent ; \
|
||||
apt-get clean ; \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
## Add the Module user
|
||||
ARG UNAME=module
|
||||
ARG UHOME="/home/$UNAME"
|
||||
ARG UNAME
|
||||
ARG UHOME
|
||||
RUN useradd --create-home --home-dir $UHOME $UNAME
|
||||
|
||||
## Debian update; install dependencies for: C++ compiler; OpenPGP; Libbitcoin; GPG
|
||||
FROM updated-debian AS development
|
||||
|
||||
## Debian update; install dependencies for: C++ compiler; OpenPGP; Libbitcoin
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
RUN set -ex ; apt-get update && apt-get upgrade -y ; \
|
||||
apt-get -y install --no-install-recommends build-essential libssl-dev libcurl4-openssl-dev make cmake gcc g++ git ; \
|
||||
apt-get -y install --no-install-recommends libgmp-dev libbz2-dev libzip-dev ; \
|
||||
apt-get -y install --no-install-recommends autoconf automake libtool pkg-config wget ; \
|
||||
apt-get -y install --no-install-recommends gpg gpg-agent
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install --no-install-recommends build-essential libssl-dev libcurl4-openssl-dev make cmake gcc g++ git
|
||||
RUN apt-get -y install --no-install-recommends libgmp-dev libbz2-dev libzip-dev
|
||||
RUN apt-get -y install --no-install-recommends autoconf automake libtool pkg-config wget
|
||||
|
||||
## Avoid error: "Server Certificate Verification Failed. CRLfile: none"
|
||||
RUN set -ex ; apt-get update ; apt-get install -y --reinstall ca-certificates #; rm -Rf /var/lib/apt/lists/*
|
||||
RUN apt-get install -y --reinstall ca-certificates
|
||||
|
||||
ARG UNAME
|
||||
ARG UHOME
|
||||
|
||||
## Install OpenPGP
|
||||
RUN set -ex ; su -l --shell /bin/bash $UNAME -c 'git clone https://github.com/calccrypto/OpenPGP ; \
|
||||
RUN su -l --shell /bin/bash $UNAME -c 'git clone https://github.com/calccrypto/OpenPGP ; \
|
||||
mkdir OpenPGP/build ; cd OpenPGP/build ; \
|
||||
sed -i "s/master/main/" ../contrib/cmake/GoogleTest.txt.in ; \
|
||||
cmake -DUSE_OPENSSL=ON -DGPG_COMPATIBLE=ON .. ; \
|
||||
make' ; \
|
||||
cd $UHOME/OpenPGP/build/ ; \
|
||||
make install ; \
|
||||
rm -Rf $UHOME/OpenPGP
|
||||
make install
|
||||
|
||||
## Install Yaml-cpp
|
||||
RUN set -ex ; su -l --shell /bin/bash $UNAME -c 'git clone https://github.com/jbeder/yaml-cpp ; \
|
||||
RUN su -l --shell /bin/bash $UNAME -c 'git clone https://github.com/jbeder/yaml-cpp ; \
|
||||
mkdir yaml-cpp/build ; cd yaml-cpp/build ; \
|
||||
cmake .. ; \
|
||||
make' ; \
|
||||
cd $UHOME/yaml-cpp/build/ ; \
|
||||
make install ; \
|
||||
rm -Rf $UHOME/yaml-cpp
|
||||
make install
|
||||
|
||||
## Install Libbitcoin explorer
|
||||
RUN set -ex ; su -l --shell /bin/bash $UNAME -c 'wget https://raw.githubusercontent.com/libbitcoin/libbitcoin-explorer/version3/install.sh ; \
|
||||
RUN su -l --shell /bin/bash $UNAME -c 'wget https://raw.githubusercontent.com/libbitcoin/libbitcoin-explorer/version3/install.sh ; \
|
||||
chmod +x install.sh' ; \
|
||||
cd $UHOME ; \
|
||||
sed -i '/git clone / s/git.*$/while true; do & \&\& break; done/' install.sh ; \
|
||||
sed -i '/wget / s/wget.*$/while true; do & \&\& break; done/' install.sh ; \
|
||||
./install.sh --build-boost --build-zmq --disable-shared ; \
|
||||
rm -Rf $UHOME/build-libbitcoin-explorer $UHOME/install.sh
|
||||
./install.sh --build-boost --build-zmq --disable-shared
|
||||
|
||||
## Install BitDeals dm
|
||||
RUN set -ex ; su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \
|
||||
RUN su -l --shell /bin/bash $UNAME -c 'cd '$UHOME' ; \
|
||||
git clone https://bitbucket.org/bitdeals/apostol-dm.git ; \
|
||||
cd apostol-dm ; \
|
||||
./configure ; \
|
||||
cd cmake-build-release ; \
|
||||
make' ; \
|
||||
cd $UHOME/apostol-dm/cmake-build-release ;\
|
||||
make install ; \
|
||||
rm -Rf $UHOME/apostol-dm
|
||||
make install
|
||||
|
||||
FROM updated-debian
|
||||
|
||||
COPY --from=development /usr/local/ /usr/local/
|
||||
COPY --from=development /etc/dm/ /etc/dm/
|
||||
COPY --from=development /usr/sbin/dm /usr/sbin/dm
|
||||
COPY --from=development /etc/init.d/dm /etc/init.d/dm
|
||||
|
||||
#dm: error while loading shared libraries: libOpenPGP.so: cannot open shared object file: No such file or directory
|
||||
RUN ldconfig
|
||||
|
||||
## Copy configuration helper script
|
||||
ADD https://bitbucket.org/bitdeals/apostol-dm/raw/master/docker/entrypoint.sh /entrypoint.sh
|
||||
#COPY ./entrypoint.sh /entrypoint.sh
|
||||
RUN set -ex ; chmod 755 /entrypoint.sh
|
||||
#ADD https://bitbucket.org/bitdeals/apostol-dm/raw/master/docker/entrypoint.sh /entrypoint.sh
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
RUN chmod 755 /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user