zoukankan      html  css  js  c++  java
  • Docker在Centos下使用Dockerfile构建远程Tomcat和Jenkins镜像

    镜像构建准备环境原料

    构建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/

  • 相关阅读:
    2040 打开所有的灯
    1323 删数问题(加强版)
    1087 FBI树
    1030 求先序排列
    1743 矩阵Ⅲ
    svn更新时,出现不知道这样的主机的解决方案
    用jquery或js获取select标签中选中的option值及文本
    html页面中的button按钮会自动提交form表单的问题以及解决方案
    localStorage与sessionStorage的使用和区别
    命令行mvn打包
  • 原文地址:https://www.cnblogs.com/boonya/p/7359604.html
Copyright © 2011-2022 走看看