• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Sarcouy/s2i-tomcat: s2i for apache-tomcat maven java apps

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Sarcouy/s2i-tomcat

开源软件地址(OpenSource Url):

https://github.com/Sarcouy/s2i-tomcat

开源编程语言(OpenSource Language):

Shell 100.0%

开源软件介绍(OpenSource Introduction):

Tomcat - CentOS Docker image

All of that is sampled from Wildfly openshift s2i project

Supported tags and respective Dockerfile links for image s2i-tomcat

This repository contains the source for building various versions of the Tomcat application as a reproducible Docker image using source-to-image. The resulting image can be run using Docker.

Versions

Tomcat versions currently provided are:

  • Tomcat v6
  • Tomcat v7
  • Tomcat v8
  • Tomcat v8.5

CentOS versions currently provided are:

  • CentOS7

Java versions currently provided are:

  • Openjdk-7
  • Openjdk-8

Maven versions currently provided are:

  • maven-3.2.5
  • maven-3.3.9
  • maven-3.5.0

Installation

This image is available on DockerHub. To download it, run:

$ docker pull sarcouy/s2i-tomcat:$TOMCAT_VERSION-jdk$JDK_VERSION-mvn$MAVEN_VERSION

for example

$ docker pull sarcouy/s2i-tomcat:8.5-jdk8-mvn3.3.9 

Usage

To build a simple java maven tomcat using standalone S2I and then run the resulting image with Docker execute:

$ s2i build -e WAR_NAME=app.war -e INCREMENTAL=false git://github.com/example/openshift-tomcat-example sarcouy/s2i-tomcat:8.5-jdk8-mvn3.3.9 tomcattest
$ docker run -p 8080:8080 tomcattest

If you want to use an incremental build, INCREMENTAL=true is the defaul value, so you can skip it

$ s2i build -e WAR_NAME=app.war -e INCREMENTAL=true --incremental git://github.com/example/openshift-tomcat-example sarcouy/s2i-tomcat:8.5-jdk8-mvn3.3.9 tomcattest
$ docker run -p 8080:8080 tomcattest

Accessing the application:

$ curl 127.0.0.1:8080

Repository organization

  • <Tomcat-version>
    • <Maven-version>
      • <Java-version>

        • Dockerfile

          CentOS based Dockerfile

        • s2i/bin/

          This folder contains scripts that are run by S2I:

          • assemble
          Is used to restore the build artifacts from the previous build (in case of
          'incremental build'), to install the sources into location from where the
          application will be run and prepare the application for deployment (eg.
          installing maven dependencies, building java code, etc..).
          
          • run
          This script is responsible for running the application, by using the
          Apache-tomcat application server.
          
          • save-artifacts
          In order to do an *incremental build* (iow. re-use the build artifacts
          from an already built image in a new image), this script is responsible for
          archiving those. In this image, this script will archive the
          maven dependencies.
          
        • contrib/

          • setting.xml A random setting.xml file

Image version structure

Structure: openshift/1-2-3
  1. Platform version - 8
  2. a dash "-"
  3. Java version - jdk7
  4. a dash "-"
  5. Maven version - mvn3.2.5

Example: sarcouy/s2i-tomcat:8-jdk8-mvn3.2.5 Environment variables

To set environment variables, you can place them as a key value pair into a .sti/environment file inside your source code repository or add -e FOO=BAR to s2i build -e FOO=BAR .

  • MAVEN_ARGS

    Overrides the default arguments passed to maven durin the build process

  • MAVEN_ARGS_APPEND

    This value will be appended to either the default maven arguments, or the value of MAVEN_ARGS if MAVEN_ARGS is set.

  • INCREMENTAL

    This is a boolean : Set it "true" avoid removing .m2 between two builds (but that makes heavier images). Must be used with s2i build --incremental If you don't want an incremental build, and a lighter docker image set -e INCREMENTAL=false Default to true

  • WAR_NAME

    Name of the war file to move into webapps directory after maven build WAR_NAME=myApp.war

  • POM_PATH

    Usefull for many pom.xml git repositories, specify the path to follow into the repo to find the pom file to use. default to POM_PATH=.

Copyright

Released under the Apache License 2.0. See the LICENSE file.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
talios/googleformatter-maven-plugin: Plugin for the Apache Maven build system to ...发布时间:2022-08-17
下一篇:
dgageot/maven-timeline发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap