码迷,mamicode.com
首页 > 其他好文 > 详细

Docker在Centos下使用Dockerfile构建远程Tomcat和Jenkins镜像

时间:2017-08-14 20:08:39      阅读:1123      评论:0      收藏:0      [点我收藏+]

标签:x64   mave   web app   ase   pat   使用   rem   jar   cal   

镜像构建准备环境原料

技术分享

构建CentOS Docker tomcat镜像

Dockerfile文件内容:

FROM centos:latest
MAINTAINER boonya <boonya@sina.com> 
# now add java and tomcat support in the container 
ADD jdk-8u121-linux-x64.tar.gz /usr/local/ 
ADD apache-tomcat-8.5.16.tar.gz /usr/local/ 
# ADD tomcat-users.xml /usr/local/apache-tomcat-8.5.16/conf/tomcat-users.xml
# configuration of java and tomcat ENV 
ENV JAVA_HOME /usr/local/jdk1.8.0_121 
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.16 
ENV CATALINA_BASE /usr/local/apache-tomcat-8.5.16 
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin 
# container listener port 
EXPOSE 8080 
# startup web application services by self 
CMD /usr/local/apache-tomcat-8.5.16/bin/catalina.sh run

 

Dockerfile构建命令:

docker build -t boonyadocker/centos-tomcat:allow-remote .

 

构建CentOS Docker jenkins镜像

Dockerfile文件内容:

FROM centos:latest
MAINTAINER boonya <boonya@sina.com> 
# now add java and tomcat support in the container 
ADD jdk-8u121-linux-x64.tar.gz /usr/local/ 
ADD apache-tomcat-8.5.16.tar.gz /usr/local/ 
ADD apache-maven-3.3.9-bin.tar.gz /usr/local/ 
ADD jenkins.war /usr/local/apache-tomcat-8.5.16/webapps/
# ADD tomcat-users.xml /usr/local/apache-tomcat-8.5.16/conf/tomcat-users.xml
# configuration of java and tomcat ENV 
ENV JAVA_HOME /usr/local/jdk1.8.0_121 
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 
ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.16 
ENV CATALINA_BASE /usr/local/apache-tomcat-8.5.16 
ENV MAVEN_HOME /usr/local/apache-maven-3.3.9
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin:$MAVEN_HOME/bin 
# container listener port 
EXPOSE 8080 
# startup web application services by self 
CMD /usr/local/apache-tomcat-8.5.16/bin/catalina.sh run

 

Dockerfile构建命令:

docker build -t boonyadocker/centos-jenkins:allow-remote .

 

镜像已上传:https://hub.docker.com/

Docker在Centos下使用Dockerfile构建远程Tomcat和Jenkins镜像

标签:x64   mave   web app   ase   pat   使用   rem   jar   cal   

原文地址:http://www.cnblogs.com/boonya/p/7359604.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!