-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
66 lines (56 loc) · 1.91 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
FROM ubuntu:latest
MAINTAINER meicorl
# 安装常用工具
RUN apt-get update -y
RUN apt install -y vim wget git lsof curl net-tools
# 安装c++编译工具
RUN apt install -y libssl-dev build-essential
# 安装cmake
RUN wget https://cmake.org/files/v3.27/cmake-3.27.0-linux-x86_64.tar.gz \
&& tar -zxvf cmake-3.27.0-linux-x86_64.tar.gz \
&& ln -s /cmake-3.27.0-linux-x86_64/bin/* /usr/local/bin
# 安装、运行etcd
RUN wget https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz \
&& tar -zxvf etcd-v3.5.0-linux-amd64.tar.gz \
&& ln -s /etcd-v3.5.0-linux-amd64/etcd /usr/local/bin/etcd \
&& ln -s /etcd-v3.5.0-linux-amd64/etcdctl /usr/local/bin/etcdctl \
&& ln -s /etcd-v3.5.0-linux-amd64/etcdutl /usr/local/bin/etcdutl \
&& etcd &
# 安装protobuf & gRPC
RUN apt install -y libboost-all-dev libgrpc-dev libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc
# 安装cpprestsdk
RUN git clone https://github.com/microsoft/cpprestsdk.git \
&& cd cpprestsdk \
&& mkdir build \
&& cd build \
&& cmake .. -DCPPREST_EXCLUDE_WEBSOCKETS=ON \
&& make -j$(nproc) \
&& make install
# 安装etcd-cpp-apiv3
RUN git clone https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3.git \
&& cd etcd-cpp-apiv3 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make -j$(nproc) \
&& make install
# 安装brpc及其依赖
RUN apt install -y libgflags-dev libprotoc-dev protobuf-compiler libleveldb-dev
RUN git clone https://github.com/apache/brpc.git \
&& cd brpc \
&& sh config_brpc.sh --headers=/usr/include --libs=/usr/lib \
&& make -j8
# 安装mysqlclient开发库
RUn apt install -y libmysqlclient-dev
# 安装redis-plus-plus
RUN git clone https://github.com/redis/hiredis.git \
&& cd hiredis \
&& make \
&& make install \
&& cd .. \
&& git clone https://github.com/sewenew/redis-plus-plus.git \
&& cd redis-plus-plus \
&& mkdir build && cd build \
&& cmake .. \
&& make -j4 \
&& make install