dockerfile
FROM centos:7
# 基于centos7安装jdk8、tomcat8.5
MAINTAINER zhanghw <[email protected]>
# 安装unzip、vim、net-tools、bzip2
RUN yum install -y unzip \
&& yum -y clean all
# 解决时区问题
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
# 解决中文乱码问题
#RUN yum install kde-l10n-Chinese -y
ENV LANG zh_CN.uft8
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.UFT-8 \
&& echo ‘LANG="zh_CN.uft8"‘ > /etc/locale.conf \
&& source /etc/locale.conf
# 安装jdk 需要与Dockerfile文件同级resources目录下提供jdk-8u231-linux-x64.tar.gz
COPY ./resources/jdk-8u231-linux-x64.tar.gz /usr/local/
RUN tar -zxf /usr/local/jdk-8u231-linux-x64.tar.gz -C /usr/local/ \
&& rm -rf /usr/local/jdk-8u231-linux-x64.tar.gz
ENV JAVA_HOME=/usr/local/jdk1.8.0_231
ENV PATH $PATH:$JAVA_HOME/bin
# 安装tomcat 需要与Dockerfile文件同级resources目录下提供apache-tomcat-8.5.47.tar.gz
COPY ./resources/apache-tomcat-8.5.47.tar.gz /usr/local/
RUN tar -zxf /usr/local/apache-tomcat-8.5.47.tar.gz -C /usr/local/ \
&& mv /usr/local/apache-tomcat-8.5.47 /usr/local/tomcat \
&& rm -rf /usr/local/apache-tomcat-8.5.47.tar.gz
# scp Dockerfile [email protected]:/home/dataexa/insight-microservice-docker/workspace/base-mirrors/insight-base/
# docker build -t insight-base ./
# 852MB
原文地址:https://www.cnblogs.com/pythonx/p/12074622.html