-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
157 lines (143 loc) · 5.13 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Proxygen Dockerfile for Ubuntu
#
# Copyright (c) 2019 Neomantra BV.
# Released under the MIT License, see LICENSE.txt
#
# See README.md for more information.
#
# Build Arguments:
# PROXYGEN_BUILD_FROM_BASE="cosmic"
# PROXYGEN_BUILD_FROM_TAG="ubuntu"
# PROXYGEN_BUILD_FROM
# J_LEVEL=1
# COMMON_VERSION="2019.06.17.00"
# FOLLY_VERSION
# FIZZ_VERSION
# WANGLE_VERSION
# PROXYGEN_VERSION
#
###############################################################################
# Build and install dependencies
###############################################################################
ARG PROXYGEN_BUILD_FROM_BASE="ubuntu"
ARG PROXYGEN_BUILD_FROM_TAG="cosmic"
ARG PROXYGEN_BUILD_FROM="${PROXYGEN_BUILD_FROM_BASE}:${PROXYGEN_BUILD_FROM_TAG}"
FROM ${PROXYGEN_BUILD_FROM}
ARG PROXYGEN_BUILD_FROM_BASE="ubuntu"
ARG PROXYGEN_BUILD_FROM_TAG="cosmic"
ARG PROXYGEN_BUILD_FROM="${PROXYGEN_BUILD_FROM_BASE}:${PROXYGEN_BUILD_FROM_TAG}"
LABEL maintainer="Evan Wies <evan@neomantra.net>"
# Debian Package Dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
autoconf \
autoconf-archive \
automake \
binutils-dev \
bison \
ca-certificates \
cmake \
curl \
flex \
g++ \
git \
gperf \
libboost-all-dev \
libcap-dev \
libdouble-conversion-dev \
libevent-dev \
libgflags-dev \
libgmock-dev \
libgoogle-glog-dev \
libiberty-dev \
libjemalloc-dev \
libkrb5-dev \
liblz4-dev \
liblzma-dev \
libnuma-dev \
libsasl2-dev \
libsnappy-dev \
libsodium-dev \
libssl-dev \
libtool \
make \
pkg-config \
unzip \
wget \
zlib1g-dev
ARG J_LEVEL=1
# Common default version for all libs, but one can override with specific ARGs
ARG COMMON_VERSION="2019.06.17.00"
# Install folly
ARG FOLLY_VERSION="${COMMON_VERSION}"
RUN cd /tmp \
&& curl -fSL https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz -o ${FOLLY_VERSION}.tar.gz \
&& tar --no-same-owner -xzf ${FOLLY_VERSION}.tar.gz \
&& cd folly-${FOLLY_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake configure -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON .. \
&& make -j${J_LEVEL} \
&& make -j${J_LEVEL} install \
&& cd /tmp \
&& rm -rf ${FOLLY_VERSION}.tar.gz folly-${FOLLY_VERSION} \
&& /sbin/ldconfig
# Install fizz
ARG FIZZ_VERSION="${COMMON_VERSION}"
RUN cd /tmp \
&& curl -fSL https://github.com/facebookincubator/fizz/archive/v${FIZZ_VERSION}.tar.gz -o ${FIZZ_VERSION}.tar.gz \
&& tar --no-same-owner -xzf ${FIZZ_VERSION}.tar.gz \
&& cd fizz-${FIZZ_VERSION} \
&& mkdir _build \
&& cd _build \
&& cmake configure -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../fizz \
&& make -j${J_LEVEL} \
&& ctest \
&& make install -j${J_LEVEL} \
&& cd /tmp \
&& rm -rf ${FIZZ_VERSION}.tar.gz fizz-${FIZZ_VERSION} \
&& /sbin/ldconfig
# Install wangle
#
# Tests exclude Bootstrap.UDPClientServerTest
# unknown file: Failure
# C++ exception with description "AsyncSocketException: failed to bind the async udp socket for:[::1]:0, type = Socket not open, errno = 99 (Cannot assign requested address)" thrown in the test body.
# [ FAILED ] Bootstrap.UDPClientServerTest (11 ms)
# -E Bootstrap.UDPClientServerTest
ARG WANGLE_VERSION="${COMMON_VERSION}"
RUN cd /tmp \
&& curl -fSL https://github.com/facebook/wangle/archive/v${WANGLE_VERSION}.tar.gz -o ${WANGLE_VERSION}.tar.gz \
&& tar --no-same-owner -xzf ${WANGLE_VERSION}.tar.gz \
&& cd wangle-${WANGLE_VERSION}/wangle \
&& cmake configure -DBUILD_SHARED_LIBS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON . \
&& make -j${J_LEVEL} \
&& ctest -j${J_LEVEL} --rerun-failed -V \
-E Bootstrap \
&& make install -j${J_LEVEL} \
&& cd /tmp \
&& rm -rf ${WANGLE_VERSION}.tar.gz wangle-${WANGLE_VERSION} \
&& /sbin/ldconfig
# Install proxygen
ARG PROXYGEN_VERSION="${COMMON_VERSION}"
RUN cd /tmp \
&& curl -fSL https://github.com/facebook/proxygen/archive/v${PROXYGEN_VERSION}.tar.gz -o ${PROXYGEN_VERSION}.tar.gz \
&& tar --no-same-owner -xzf ${PROXYGEN_VERSION}.tar.gz \
&& cd proxygen-${PROXYGEN_VERSION}/proxygen \
&& autoreconf -ivf \
&& ./configure \
&& make -j${J_LEVEL} \
&& LD_LIBRARY_PATH=/usr/local/lib make check \
&& make install -j${J_LEVEL} \
&& cd /tmp \
&& rm -rf ${PROXYGEN_VERSION}.tar.gz proxygen-${PROXYGEN_VERSION} \
&& rm -rf proxygen AsyncTimeoutSetTest* CodecTests* LibHTTPTests* SessionTests* UtilTests* lt-HTTPServerTests* \
&& /sbin/ldconfig
# Apply labels
LABEL proxygen_build_from_base="${PROXYGEN_BUILD_FROM_BASE}"
LABEL proxygen_build_from_tag="${PROXYGEN_BUILD_FROM_TAG}"
LABEL proxygen_build_from="${PROXYGEN_BUILD_FROM}"
LABEL common_version="${COMMON_VERSION}"
LABEL folly_version="${FOLLY_VERSION}"
LABEL fizz_version="${FIZZ_VERSION}"
LABEL wangle_version="${WANGLE_VERSION}"
LABEL proxygen_version="${PROXYGEN_VERSION}"