-
Notifications
You must be signed in to change notification settings - Fork 329
/
Dockerfile
57 lines (53 loc) · 1.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
ARG PARENT_VERSION=latest
FROM p4lang/pi:${PARENT_VERSION}
LABEL maintainer="P4 Developers <[email protected]>"
# Select the type of image we're building. Use `build` for a normal build, which
# is optimized for image size. Use `test` if this image will be used for
# testing; in this case, the source code and build-only dependencies will not be
# removed from the image.
ARG IMAGE_TYPE=build
ARG CC=gcc
ARG CXX=g++
ARG GCOV=
ARG sswitch_grpc=yes
ENV BM_DEPS automake \
build-essential \
clang-8 \
clang-10 \
curl \
git \
lcov \
libgmp-dev \
libpcap-dev \
libboost-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-thread-dev \
libtool \
pkg-config
ENV BM_RUNTIME_DEPS libboost-program-options1.71.0 \
libboost-system1.71.0 \
libboost-filesystem1.71.0 \
libboost-thread1.71.0 \
libgmp10 \
libpcap0.8 \
python3 \
python-is-python3
COPY . /behavioral-model/
WORKDIR /behavioral-model/
RUN apt-get update -qq && \
apt-get install -qq --no-install-recommends $BM_DEPS $BM_RUNTIME_DEPS && \
./autogen.sh && \
if [ "$GCOV" != "" ]; then ./configure --with-pdfixed --with-pi --with-stress-tests --enable-debugger --enable-coverage --enable-Werror; fi && \
if [ "$GCOV" = "" ]; then ./configure --with-pdfixed --with-pi --with-stress-tests --enable-debugger --enable-Werror; fi && \
make -j$(nproc) && \
make install-strip && \
ldconfig && \
(test "$IMAGE_TYPE" = "build" && \
apt-get purge -qq $BM_DEPS && \
apt-get autoremove --purge -qq && \
rm -rf /behavioral-model /var/cache/apt/* /var/lib/apt/lists/* && \
echo 'Build image ready') || \
(test "$IMAGE_TYPE" = "test" && \
echo 'Test image ready')