-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
51 lines (41 loc) · 2.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
FROM centos
WORKDIR /root/
#拷贝资源
COPY init /root/init/
COPY entrypoint.sh /sbin/
#安装glibc-devel flex、bison mysql 支持库 中文乱码
RUN yum install -y git gcc gcc-c++ make wget cmake mysql mysql-devel unzip iproute which glibc-devel flex bison ncurses-devel zlib-devel kde-l10n-Chinese glibc-common && yum clean all
WORKDIR /root/
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV LC_ALL zh_CN.utf8
ENV DBIP 127.0.0.1
ENV DBPort 3306
ENV DBUser root
ENV DBPassword password
##安装JDK
RUN cd /root/init/ && wget --header "Cookie: oraclelicense=accept" -c --no-check-certificate http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm && rpm -ivh /root/init/jdk-8u131-linux-x64.rpm && rm -rf /root/init/jdk-8u131-linux-x64.rpm
RUN echo "export JAVA_HOME=/usr/java/jdk1.8.0_131" >> /etc/profile && echo "CLASSPATH=\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar" >> /etc/profile && echo "PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile && echo "export PATH JAVA_HOME CLASSPATH" >> /etc/profile
ENV JAVA_HOME /usr/java/jdk1.8.0_131
##安装Maven
RUN cd /usr/local/ && wget http://mirrors.gigenet.com/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz && tar zxvf apache-maven-3.5.0-bin.tar.gz && echo "export MAVEN_HOME=/usr/local/apache-maven-3.5.0/" >> /etc/profile && echo "export PATH=\$PATH:\$MAVEN_HOME/bin" >> /etc/profile && source /etc/profile && mvn -v && rm -rf apache-maven-3.5.0-bin.tar.gz
ENV MAVEN_HOME /usr/local/apache-maven-3.5.0
##安装resin
RUN cd /usr/local/ && wget http://caucho.com/download/resin-4.0.51.tar.gz && tar zxvf resin-4.0.51.tar.gz && mv resin-4.0.51 resin && rm -rf resin-4.0.51.tar.gz
RUN mkdir -p /usr/local/mysql && ln -s /usr/lib64/mysql /usr/local/mysql/lib && ln -s /usr/include/mysql /usr/local/mysql/include && echo "/usr/local/mysql/lib/" >> /etc/ld.so.conf && ldconfig
RUN cd /usr/local/mysql/lib/ && ln -s libmysqlclient.so.*.*.* libmysqlclient.a
RUN git clone https://github.com/Tencent/Tars.git
##安装java语言框架
RUN source /etc/profile &&cd /root/Tars/java && mvn clean install && mvn clean install -f core/client.pom.xml && mvn clean install -f core/server.pom.xml
##安装c++语言框架
RUN cd /root/Tars/cpp/thirdparty && sh thirdparty.sh
RUN chmod u+x /root/Tars/cpp/build/build.sh && /root/Tars/cpp/build/build.sh all && /root/Tars/cpp/build/build.sh install
##打包框架基础服务
RUN cd /root/Tars/cpp/build/ && make framework-tar
RUN cd /root/Tars/cpp/build/ && make tarsstat-tar && make tarsnotify-tar && make tarsproperty-tar && make tarslog-tar && make tarsquerystat-tar && make tarsqueryproperty-tar
##安装核心基础服务
RUN mkdir -p /usr/local/app/tars/ && cp /root/Tars/cpp/build/framework.tgz /usr/local/app/tars/
RUN cd /usr/local/app/tars/ && tar xzfv framework.tgz && rm -rf framework.tgz
ENTRYPOINT ["/bin/bash","/sbin/entrypoint.sh"]
CMD ["start"]
#Expose ports
EXPOSE 8080