Sign inSign up

eliu/tomcat

By eliu

•Updated almost 8 years ago

Tomcat image optimized for HAP

Image
0

3.3K

eliu/tomcat repository overview

⁠Base image:
  • tomcat:8.5-slim
⁠Features:
  • Set jarsToSkip as *.jar to avoid Excpetions during deployment
  • Add setenv.sh to make tweaks to JAVA_OPTS
⁠Environment Variables

Since 8.5-hap-v1.0.0, the following environment variables are supported:

VariableMeaninge.g
DS_DRIVER_CLASS_NAMEDriver Class Namecom.mysql.jdbc.Driver
DS_NAMEDatasource Namehap_demo
DS_URLConnect URLjdbc:mysql://mysql-server:3306/hap_demo
DS_USERNAMEConnect User Namehap_demo
DS_PASSWORDConnect Passwordhap_demo

The variables listed above will be used in context.xml as follows:

<Resource auth="Container" type="javax.sql.DataSource"
        driverClassName="{{DS_DRIVER_CLASS_NAME}}" 
        url="{{DS_URL}}" 
        name="jdbc/{{DS_NAME}}" 
        username="{{DS_USERNAME}}" 
        password="{{DS_PASSWORD}}"/>
⁠Instructions

Launch tomcat server for HAP:

docker run -d --name tomcat \
    -p 8080:8080 \
    -v /path/to/hap/core/target/core.war:/usr/local/tomcat/webapps/core.war \
    --link redis:redis \
    --link rabbitmq:rabbitmq \
    --env-file /path/to/env-file.properties \
    eliu/tomcat:8.5-hap-v1.0.1

the content of env-file.properties might be something like this:

DS_DRIVER_CLASS_NAME=oracle.jdbc.driver.OracleDriver
DS_NAME=hap_dev
DS_USERNAME=username
DS_PASSWORD=password
DS_URL=jdbc:oracle:thin:@127.0.0.1:1521/service_name

Tag summary

Content type

Image

Digest

Size

85.8 MB

Last updated

almost 8 years ago

docker pull eliu/tomcat