docker 制作tomcat镜像

FROM centos:centos7
MAINTAINER ajia
RUN yum -y install openssl gcc gcc-c++ wget apr-devel openssl-devel
RUN yum -y install kde-l10n-Chinese
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV LC_ALL zh_CN.utf8
RUN mkdir -p /data
#添加当前目录到镜像目录,镜像中没有会自动生成一个目录
ADD jdk7 /data/jdk7
ADD tomcat /home/tomcat
#添加java环境变量,修改docker容器编码格式
ENV JAVA_HOME=/data/jdk7
ENV CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/tools.jar
ENV PATH=$PATH:${JAVA_HOME}/bin
ENV LANG C.UTF-8
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#3.apr启动优化
RUN cd /home/tomcat/bin  && mkdir -p /usr/local/apr \
&& tar -zxvf tomcat-native.tar.gz -C /usr/local/apr \
&& cd /usr/local/apr/tomcat-native-1.2.14-src/native \
&& ./configure --prefix=/usr/local/apr \
&& make && make install
EXPOSE 8080 443
CMD ["/home/tomcat/bin/catalina.sh","run"]

你可能感兴趣的:(docker,linux,基础知识,docker,tomcat,容器)