首页 > 代码库 > Docker在Centos下使用Dockerfile构建远程Tomcat和Jenkins镜像
Docker在Centos下使用Dockerfile构建远程Tomcat和Jenkins镜像
镜像构建准备环境原料
构建CentOS Docker tomcat镜像
Dockerfile文件内容:
FROM centos:latestMAINTAINER 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:latestMAINTAINER 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.9ENV 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镜像
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。