-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
77 lines (62 loc) · 2.98 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM golang:1.21.0-bullseye
# This docker file prepare environment to build the full bdk inside a docker
#
# To build it using one of these approaches
#
# docker build -t bdk:dev .
# docker buildx build --platform linux/amd64 -t bdkbuilder:amd . # uname -m
# docker buildx build --platform linux/arm64 -t bdkbuilder:arm . # uname -m
# docker buildx build --platform linux/amd64,linux/arm64 -t bdkbuilder:cross .
#
# To run and test it, assuming there are the bitcoin-sv source code along side with bdk
#
# # $PWD is the parent/parent directory containing source code of both bitcoin-sv and bdk
# docker run -it --name buildbdk --rm --mount type=bind,source="${PWD}",target=/development bdk:dev /bin/bash
#
# Then inside the docker
#
# cd /development && mkdir dockerbuild && cd dockerbuild && cmake ../bitcoin-sv/bdk/ -DCUSTOM_SYSTEM_OS_NAME=docker && make -j8 && make install && make test && cpack -G TGZ
#
#
WORKDIR /download
# Install build dependencies
RUN apt-get update && apt-get install -y \
wget p7zip-full \
libssl-dev \
build-essential \
checkinstall \
zlib1g-dev \
python3 python3-pip python3-dev python-is-python3 \
openjdk-11-jdk
# Finalize setup java jdk
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ENV PATH="$JAVA_HOME/bin:$PATH"
# Install python packages for building documentation
RUN python -m pip install pytest mkdocs pymdown-extensions plantuml_markdown
# Build/Install from source CMake 3.30.3
RUN wget https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3.tar.gz \
&& tar -xzvf cmake-3.30.3.tar.gz \
&& cd cmake-3.30.3 \
&& ./bootstrap --parallel=$(nproc) --no-qt-gui --prefix=/usr/local/cmake-3.30.3 \
&& make -j$(nproc) && make install
ENV PATH="/usr/local/cmake-3.30.3/bin:$PATH"
# Build from source OpenSSL 3.0.9 - static only
RUN wget https://www.openssl.org/source/openssl-3.0.9.tar.gz \
&& tar -xvzf openssl-3.0.9.tar.gz \
&& cd openssl-3.0.9 \
&& ./config no-shared --prefix=/usr/local/openssl-3.0.9 \
&& make -j$(nproc) \
&& make install_sw
ENV OPENSSL_ROOT_DIR=/usr/local/openssl-3.0.9
# Build from source Boost 1.85.0 - static only
# We still have to build with ./b2 (instead of cmake) because bullseye only have g++10
# Which make issue when compiling boost with cmake
RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.gz \
&& tar -xvzf boost_1_85_0.tar.gz && cd boost_1_85_0 \
&& ./bootstrap.sh --prefix="/usr/local/boost_1_85_0" && ./b2 link=static cxxflags="-fPIC" cflags="-fPIC" --without-stacktrace -j$(nproc) --prefix="/usr/local/boost_1_85_0" install
ENV BOOST_ROOT=/usr/local/boost_1_85_0
## Cleanup the download
RUN rm -fR /download/*
## Config so git command work. It is needed to retrieve the source code version
RUN git config --global --add safe.directory '*'
WORKDIR /development