forked from line/centraldogma
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.centos7
More file actions
57 lines (45 loc) · 1.65 KB
/
Copy pathDockerfile.centos7
File metadata and controls
57 lines (45 loc) · 1.65 KB
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
# This builds a Thrift binary without library support (only for code generation),
# because the Apache Thrift official repo no longer maintains a binary distribution
FROM centos:centos7 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Since CentOS 7 has reached End of Life, we need to update the mirrors,
# see https://www.redhat.com/en/blog/centos-linux-has-reached-its-end-life-eol
# and https://serverfault.com/a/1161847
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/CentOS-*.repo && \
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/CentOS-*.repo && \
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/CentOS-*.repo
# See https://archive.apache.org/dist/thrift/
ENV THRIFT_VERSION=0.23.0
# See https://thrift.apache.org/docs/install/centos.html
RUN yum update -y -q && \
yum -y groupinstall "Development Tools" && \
yum install -y \
automake \
bison \
flex \
g++ \
git \
libboost-all-dev \
libevent-dev \
libssl-dev \
libtool \
make \
pkg-config
ADD https://archive.apache.org/dist/thrift/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}.tar.gz /tmp/thrift.tar.gz
RUN echo "1859d932d2ae1f13d16c5a196931208c116310a5ff50f2bfd11d3db03be8f46f /tmp/thrift.tar.gz" | sha256sum -c && \
tar xzf /tmp/thrift.tar.gz -C /tmp
RUN cd /tmp/thrift-${THRIFT_VERSION} && \
./bootstrap.sh && \
./configure \
--disable-debug \
--disable-tests \
--disable-libs \
&& \
make -j$(nproc) && \
make install
# Minimizing Thrift binary size
RUN strip /usr/local/bin/thrift
FROM centos:centos7
COPY --from=builder /usr/local/bin/thrift /usr/local/bin/thrift
ENTRYPOINT [ "/usr/local/bin/thrift" ]
CMD [ "-help" ]