forked from p4lang/behavioral-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.grpc
106 lines (92 loc) · 3.12 KB
/
Dockerfile.grpc
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM ubuntu:16.04
MAINTAINER Antonin Bas <[email protected]>
ARG MAKEFLAGS
ENV MAKEFLAGS ${MAKEFLAGS:--j2}
RUN apt-get update && \
apt-get install -y --no-install-recommends git ca-certificates
# Build Protocol Buffers.
ENV PROTOCOL_BUFFERS_DEPS autoconf \
automake \
g++ \
libtool \
make \
curl \
unzip
RUN git clone https://github.com/google/protobuf.git
WORKDIR /protobuf/
RUN git checkout tags/v3.2.0
RUN apt-get update && \
apt-get install -y --no-install-recommends $PROTOCOL_BUFFERS_DEPS && \
export CFLAGS="-Os" && \
export CXXFLAGS="-Os" && \
export LDFLAGS="-Wl,-s" && \
./autogen.sh && \
./configure && \
make && \
make install && \
ldconfig && \
apt-get purge -y $PROTOCOL_BUFFERS_DEPS && apt-get autoremove --purge -y && \
rm -rf /protobuf /var/cache/apt/* /var/lib/apt/lists/* /var/cache/debconf/* /var/lib/dpkg/*-old /var/log/*
WORKDIR /
# Build gRPC.
# The gRPC build system should detect that a version of protobuf is already
# installed and should not try to install the third-party one included as a
# submodule in the grpc repository.
ENV GRPC_DEPS build-essential \
autoconf \
libtool
RUN git clone https://github.com/google/grpc.git
WORKDIR /grpc/
RUN git checkout tags/v1.2.3 && \
git submodule update --init --recursive
RUN apt-get update && \
apt-get install -y --no-install-recommends $GRPC_DEPS libgflags-dev && \
export LDFLAGS="-Wl,-s" && \
make && \
make grpc_cli && \
make install && \
ldconfig && \
cp /grpc/bins/opt/grpc_cli /usr/bin/ && \
apt-get purge -y $GRPC_DEPS && apt-get autoremove --purge -y && \
rm -rf /grpc /var/cache/apt/* /var/lib/apt/lists/* /var/cache/debconf/* /var/lib/dpkg/*-old /var/log/*
WORKDIR /
ENV BM_DEPS automake \
build-essential \
libjudy-dev \
libgmp-dev \
libpcap-dev \
libboost-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-thread-dev \
libtool \
pkg-config
RUN apt-get update && \
apt-get install -y --no-install-recommends $BM_DEPS
ADD https://api.github.com/repos/p4lang/PI/git/refs/heads/master .PI.head.json
RUN git clone https://github.com/p4lang/PI/
WORKDIR /PI
RUN git submodule update --init --recursive
RUN export CFLAGS="-O0" && \
export CXXFLAGS="-O0" && \
./autogen.sh && \
./configure --with-proto --without-cli --without-internal-rpc && \
make && \
make install && ldconfig && \
rm -rf /PI/
WORKDIR /
COPY . /behavioral-model/
WORKDIR /behavioral-model/
RUN export CFLAGS="-O0" && \
export CXXFLAGS="-O0" && \
./autogen.sh && \
./configure --without-thrift --without-nanomsg --with-pi && \
make && \
make install && ldconfig
WORKDIR /behavioral-model/targets/simple_switch_grpc
RUN export CFLAGS="-O0" && \
export CXXFLAGS="-O0" && \
./autogen.sh && \
./configure &&\
make