forked from clearmatics/zeth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-base
64 lines (56 loc) · 1.82 KB
/
Dockerfile-base
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
FROM alpine:3.12
####
# This Dockerfile builds the base image
# (installs all the dependencies) for Zeth
####
# Install necessary packages
RUN apk --update --no-cache add \
build-base \
git \
boost-dev \
# Necessary for static builds
boost-static \
gmp-dev \
procps-dev \
g++ \
gcc \
libxslt-dev \
cmake \
libressl-dev \
pkgconfig \
sudo \
# Necessary for gRPC
automake \
autoconf \
libtool \
# Debug tools
vim \
curl
RUN git clone -b v1.31.x https://github.com/grpc/grpc /var/local/git/grpc
RUN cd /var/local/git/grpc && git submodule update --init --recursive
# Build protobuf independently and install libraries in /usr/lib
# Then use flag `-DgRPC_PROTOBUF_PROVIDER=package` in gRPC build
RUN cd /var/local/git/grpc/third_party/protobuf \
&& ./autogen.sh \
&& ./configure --prefix=/usr \
&& make -j"$($(nproc)+1)" \
&& make check \
&& make install \
&& make clean
ENV CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF"
# Build the static libraries
RUN cd /var/local/git/grpc \
&& mkdir -p cmake/build \
&& cd cmake/build \
&& cmake ${CMAKE_FLAGS} ../.. \
&& make -j"$($(nproc)+1)" \
&& make install
# Build the shared libraries
RUN cd /var/local/git/grpc \
&& rm -r cmake/build \
&& mkdir -p cmake/build \
&& cd cmake/build \
&& cmake ${CMAKE_FLAGS} -DBUILD_SHARED_LIBS=ON ../.. \
&& make -j"$($(nproc)+1)" \
&& make install
CMD ["/bin/bash"]