Created
November 7, 2022 08:54
-
-
Save thebevrishot/9fa510420cbc5b263003473dc6e0974f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:bullseye AS builder | |
RUN apt update | |
RUN apt-get install -y build-essential libtool autotools-dev automake pkg-config libssl-dev \ | |
libevent-dev bsdmainutils libgmp-dev cmake curl software-properties-common | |
# Install Berkeley DB 4.8 | |
RUN curl -L http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz | tar -xz -C /tmp && \ | |
cd /tmp/db-4.8.30/build_unix && \ | |
../dist/configure --enable-cxx --includedir=/usr/include/bdb4.8 --libdir=/usr/lib && \ | |
sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' /tmp/db-4.8.30/dbinc/atomic.h && \ | |
make -j$(nproc) && make install && \ | |
cd / && rm -rf /tmp/db-4.8.30 | |
# Install zlib | |
RUN curl -L https://www.zlib.net/zlib-1.2.13.tar.gz | tar -xz -C /tmp && \ | |
cd /tmp/zlib-1.2.13/contrib/minizip && \ | |
autoreconf -fi && \ | |
./configure --enable-shared=no --with-pic && \ | |
make -j$(nproc) install && \ | |
cd / && rm -rf /tmp/zlib-1.2.13 | |
# Install zmq from source (outdated version from apt on Ubuntu 14.04) | |
RUN curl -L https://github.com/zeromq/libzmq/releases/download/v4.3.1/zeromq-4.3.1.tar.gz | tar -xz -C /tmp && \ | |
cd /tmp/zeromq-4.3.1/ && ./configure --disable-shared --without-libsodium --with-pic && \ | |
make -j$(nproc) install && \ | |
cd / && rm -rf /tmp/zeromq-4.3.1/ | |
# Install lib boost | |
RUN curl -L https://boostorg.jfrog.io/artifactory/main/release/1.64.0/source/boost_1_64_0.tar.gz | tar -xz -C /tmp && \ | |
cd /tmp/boost_1_64_0/ && \ | |
./bootstrap.sh --prefix=/usr && \ | |
./bjam -j$(nproc) install | |
WORKDIR /work | |
COPY . . | |
RUN ./autogen.sh && \ | |
./configure --disable-tests --disable-bench --without-gui --prefix=`pwd`/depends/x86_64-pc-linux-gnu \ | |
LDFLAGS="-static-libstdc++ -static -L/usr/lib/x86_64-linux-gnu" \ | |
CXXFLAGS="-static" && \ | |
make clean && \ | |
make -j$(nproc) | |
RUN strip /work/src/qtumd /work/src/qtum-cli | |
FROM debian:bullseye | |
RUN apt-get update | |
RUN apt-get install -y libevent-dev libgmp-dev | |
RUN useradd -ms /bin/bash qtum | |
USER qtum | |
RUN mkdir -p /home/qtum/.qtum/ | |
RUN chown qtum:qtum /home/qtum/.qtum/ | |
# COPY --from=builder /work/qtum.regtest.conf /home/qtum/.qtum/qtum.conf | |
COPY --from=builder /work/src/qtumd /usr/local/bin | |
COPY --from=builder /work/src/qtum-cli /usr/local/bin | |
COPY --from=builder /usr/lib/libboost_system.so.1.64.0 \ | |
/usr/lib/libboost_filesystem.so.1.64.0 \ | |
/usr/lib/libboost_thread.so.1.64.0 \ | |
/usr/lib/libboost_program_options.so.1.64.0 \ | |
/usr/lib/libboost_thread.so.1.64.0 \ | |
/usr/lib/libdb_cxx-4.8.so \ | |
/usr/lib/ | |
CMD [ "qtumd", "--daemon=0", "--printtoconsole", "--rpcbind=0.0.0.0", "--rpcallowip=0.0.0.0/0" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment