-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
76 lines (63 loc) · 3.3 KB
/
Dockerfile.build
File metadata and controls
76 lines (63 loc) · 3.3 KB
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
ARG base_os=ubuntu
ARG base_tag=latest
FROM ${base_os}:${base_tag}
MAINTAINER testillano
ARG base_os=ubuntu
LABEL testillano.diametercodec_builder.description="Docker image to build ert_diametercodec library"
WORKDIR /code/build
ARG make_procs=4
ARG build_type=Release
ARG ert_logger_ver=v1.1.0
ARG nlohmann_json_ver=v3.10.5
ARG pboettch_jsonschemavalidator_ver=2.1.0
ARG jupp0r_prometheuscpp_ver=v0.13.0
ARG civetweb_civetweb_ver=v1.14
ARG ert_metrics_ver=v1.1.0
ARG google_test_ver=v1.11.0
RUN if [ "${base_os}" = "alpine" ] ; then apk update && apk add build-base cmake wget tar linux-headers openssl-dev libev-dev openssl-libs-static doxygen graphviz git && rm -rf /var/cache/apk/* ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get update && apt-get install -y wget make cmake g++ bzip2 patch libssl-dev doxygen graphviz git && apt-get clean ; fi
# ert_logger
RUN set -x && \
wget https://github.com/testillano/logger/archive/${ert_logger_ver}.tar.gz && tar xvf ${ert_logger_ver}.tar.gz && cd logger-*/ && \
cmake -DERT_LOGGER_BuildExamples=OFF -DCMAKE_BUILD_TYPE=${build_type} . && make -j${make_procs} && make install && \
cd .. && rm -rf * && \
set +x
# nlohmann json
RUN set -x && \
wget https://github.com/nlohmann/json/releases/download/${nlohmann_json_ver}/json.hpp && \
mkdir /usr/local/include/nlohmann && mv json.hpp /usr/local/include/nlohmann && \
set +x
# pboettch json-schema-validator
RUN set -x && \
wget https://github.com/pboettch/json-schema-validator/archive/${pboettch_jsonschemavalidator_ver}.tar.gz && \
tar xvf ${pboettch_jsonschemavalidator_ver}.tar.gz && cd json-schema-validator*/ && mkdir build && cd build && \
cmake .. && make -j${make_procs} && make install && \
cd ../.. && rm -rf * && \
set +x
# jupp0r prometheus-cpp
RUN if [ "${base_os}" = "alpine" ] ; then apk add zlib-dev curl-dev && rm -rf /var/cache/apk/* ; elif [ "${base_os}" = "ubuntu" ] ; then apt-get install -y zlib1g-dev libcurl4-openssl-dev && apt-get clean ; fi
RUN set -x && \
wget https://github.com/jupp0r/prometheus-cpp/archive/refs/tags/${jupp0r_prometheuscpp_ver}.tar.gz && \
tar xvf ${jupp0r_prometheuscpp_ver}.tar.gz && cd prometheus-cpp*/3rdparty && \
wget https://github.com/civetweb/civetweb/archive/refs/tags/${civetweb_civetweb_ver}.tar.gz && \
tar xvf ${civetweb_civetweb_ver}.tar.gz && mv civetweb-*/* civetweb && cd .. && \
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=${build_type} -DENABLE_TESTING=OFF .. && \
make -j${make_procs} && make install && \
cd ../.. && rm -rf * && \
set +x
# ert_metrics
RUN set -x && \
wget https://github.com/testillano/metrics/archive/${ert_metrics_ver}.tar.gz && tar xvf ${ert_metrics_ver}.tar.gz && cd metrics-*/ && \
cmake -DERT_METRICS_BuildExamples=OFF -DCMAKE_BUILD_TYPE=${build_type} . && make -j${make_procs} && make install && \
cd .. && rm -rf * && \
set +x
# google test framework
RUN set -x && \
wget https://github.com/google/googletest/archive/refs/tags/release-$(echo ${google_test_ver} | cut -c2-).tar.gz && \
tar xvf release-$(echo ${google_test_ver} | cut -c2-).tar.gz && cd googletest-release*/ && cmake . && make -j${make_procs} install && \
cd .. && rm -rf * && \
set +x
# Build script
COPY deps/build.sh /var
RUN chmod a+x /var/build.sh
ENTRYPOINT ["/var/build.sh"]
CMD []