标签:lin ash app java_home bin dock 容器 tomcat 端口映射
使用dockerfile构建Java镜像
FROM centos:7 ADD jdk-8u211-linux-x64.tar.gz /usr/local RUN mv /usr/local/jdk1.8.0_211 /usr/local/jdk ENV JAVA_HOME=/usr/local/jdk ENV JRE_HOME=$JAVA_HOME/jre ENV CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH ENV PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH ADD apache-tomcat-8.5.35.tar.gz /usr/local RUN mv /usr/local/apache-tomcat-8.5.35 /usr/local/tomcat EXPOSE 8080 ENTRYPOINT ["/usr/local/tomcat/bin/catalina.sh","run"]
docker run -itd -p 80:8080 -v /root/test/ROOT:/usr/local/tomcat/webapps/ROOT mycentos:jdk /bin/bash
标签:lin ash app java_home bin dock 容器 tomcat 端口映射
原文地址:https://www.cnblogs.com/weisunblog/p/12237676.html