Skip to content

Commit afa7dad

Browse files
committed
chore: dockerize mcrouter
1 parent da803b1 commit afa7dad

1 file changed

Lines changed: 126 additions & 0 deletions

File tree

dockerfiles/mcrouter/Dockerfile

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
FROM debian:10.0-slim as build
2+
3+
ENV \
4+
LANG=C.UTF-8 \
5+
LC_ALL=C.UTF-8 \
6+
FBTHRIFT_VERSION=v2019.07.22.00 \
7+
FIZZ_VERSION=v2019.07.22.00 \
8+
FOLLY_VERSION=v2019.07.22.00 \
9+
MCROUTER_VERSION=v0.40.0 \
10+
WANGLE_VERSION=v2019.07.22.00
11+
12+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
13+
14+
RUN apt-get update \
15+
&& apt-get install -y --no-install-recommends \
16+
autoconf=2.69-11 \
17+
automake=1:1.16.1-4 \
18+
binutils-dev=2.31.1-16 \
19+
bison=2:3.3.2.dfsg-1 \
20+
build-essential=12.6 \
21+
ca-certificates=20190110 \
22+
cmake=3.13.4-1 \
23+
curl=7.64.0-4 \
24+
flex=2.6.4-6.2 \
25+
g++=4:8.3.0-1 \
26+
gcc=4:8.3.0-1 \
27+
git=1:2.20.1-2 \
28+
gnutls-bin=3.6.7-4 \
29+
libboost-all-dev=1.67.0.1 \
30+
libboost-context-dev=1.67.0.1 \
31+
libbz2-dev=1.0.6-9.1 \
32+
libdouble-conversion-dev=3.1.0-3 \
33+
libevent-dev=2.1.8-stable-4 \
34+
libgflags-dev=2.2.2-1 \
35+
libgoogle-glog-dev=0.3.5-1 \
36+
libgtest-dev=1.8.1-3 \
37+
libjemalloc-dev=5.1.0-3 \
38+
liblzma-dev=5.2.4-1 \
39+
libsnappy-dev=1.1.7-1 \
40+
libsodium-dev=1.0.17-1 \
41+
libssl-dev=1.1.1c-1 \
42+
libssl1.1=1.1.1c-1 \
43+
libtool=2.4.6-9 \
44+
libfmt-dev=5.2.1+ds-2 \
45+
openssl=1.1.1c-1 \
46+
pkg-config=0.29-6 \
47+
python-dev=2.7.16-1 \
48+
ragel=6.10-1 \
49+
zlib1g=1:1.2.11.dfsg-1 \
50+
zlib1g-dev=1:1.2.11.dfsg-1 \
51+
&& apt-get clean \
52+
&& rm -rf /var/lib/apt/lists/*
53+
54+
WORKDIR /usr/src/folly
55+
56+
RUN curl -Ls "https://github.com/facebook/folly/archive/${FOLLY_VERSION}.tar.gz" \
57+
| tar xvzf - --strip-components=1 \
58+
&& cmake configure . \
59+
&& make -j $(nproc) \
60+
&& make install
61+
62+
WORKDIR /usr/src/fizz
63+
64+
RUN curl -Ls "https://github.com/facebookincubator/fizz/archive/${FIZZ_VERSION}.tar.gz" \
65+
| tar xvzf - --strip-components=1 \
66+
&& cd fizz \
67+
&& cmake . \
68+
&& make -j $(nproc) \
69+
&& make install
70+
71+
WORKDIR /usr/src/wangle
72+
73+
RUN curl -Ls "https://github.com/facebook/wangle/archive/${WANGLE_VERSION}.tar.gz" \
74+
| tar xvzf - --strip-components=1 \
75+
&& cmake configure wangle \
76+
&& make -j $(nproc) \
77+
&& make install
78+
79+
WORKDIR /usr/src/fbthrift
80+
81+
RUN curl -Ls "https://github.com/facebook/fbthrift/archive/${FBTHRIFT_VERSION}.tar.gz" \
82+
| tar xvzf - --strip-components=1 \
83+
&& cd build \
84+
&& cmake -Dcompiler_only=ON .. \
85+
&& make -j $(nproc) \
86+
&& make install
87+
88+
WORKDIR /usr/src/mcrouter
89+
90+
RUN curl -Ls "https://github.com/facebook/mcrouter/archive/${MCROUTER_VERSION}.tar.gz" \
91+
| tar xvzf - --strip-components=1 \
92+
&& cd mcrouter \
93+
&& autoreconf --install \
94+
&& LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/local/lib \
95+
./configure --prefix=/usr/local/mcrouter \
96+
&& make -j $(nproc) \
97+
&& rm -rf /usr/src/*
98+
99+
#strip "$INSTALL_DIR"/bin/mcrouter
100+
#strip "$INSTALL_DIR"/bin/mcpiper
101+
#strip --strip-unneeded "$INSTALL_DIR"/lib/libfolly*.so
102+
103+
# run
104+
FROM debian:10.0-slim
105+
106+
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
107+
108+
RUN apt-get update \
109+
&& apt-get install -y --no-install-recommends \
110+
libssl1.1 \
111+
libevent-2.0-5 \
112+
libgflags2v5 \
113+
libgoogle-glog0v5 \
114+
libboost-context1.62.0 \
115+
libboost-filesystem1.62.0 \
116+
libboost-program-options1.62.0 \
117+
libboost-system1.62.0 \
118+
libboost-regex1.62.0 \
119+
libboost-thread1.62.0 \
120+
libdouble-conversion1 \
121+
&& apt-get clean \
122+
&& rm -rf /var/lib/apt/lists/*
123+
124+
COPY --from=build /mcrouter/mcrouter/mcrouter /usr/local/bin/mcrouter
125+
126+
CMD ["/usr/local/bin/mcrouter"]

0 commit comments

Comments
 (0)