Sign inSign up

envris/tomcat-jdbc

By envris

Updated almost 9 years ago

Docker base images for Tomcat applications which use JDBC database connections

Image
0

4.0K

envris/tomcat-jdbc repository overview

Docker base images for Tomcat applications which use JDBC database connections. Alpine versions are less than half the size of standard images but have virtually no packages installed and use busybox instead of bash.

Build

for file in *.Dockerfile; do
    tag=$(basename $file ".Dockerfile")
    docker build -t "envris/tomcat-jdbc:${tag}" --file $file .
done

Usage

Use envris/tomcat-jdbc as the base image for your application's image.

Place your Tomcat web application WAR file in the context directory, and any JDBC driver JAR files in the lib subdirectory. Docker onbuild instructions will add these files for you.

Example Dockerfile:

FROM envris/tomcat-jdbc:8-jre7
Configuration

To configure each JDBC resource, set the below environment variables and secrets, replacing MYRESOURCE with an identifier for that JDBC resource. Multiple JDBC resources can be defined.

For each JDBC resource, you must specify RESOURCE and either URL or HOST, PORT, NAME and (optionally) DRIVER.

NameTypeValueDefault value
MYRESOURCE_RESOURCEEnvironment VariableName of the JDBC ResourceN/A
MYRESOURCE_USEREnvironment VariableDB usernameN/A
MYRESOURCE_URLEnvironment VariableJDBC URLN/A
MYRESOURCE_DRIVEREnvironment VariableDB JDBC Driveroraclethin
MYRESOURCE_HOSTEnvironment VariableDB hostnameN/A
MYRESOURCE_PORTEnvironment VariableDB tcp portN/A
MYRESOURCE_NAMEEnvironment VariableDB instance nameN/A
myresource_passDocker secretDB passwordN/A
MYRESOURCE_MAXACTIVEEnvironment VariablemaxActive Attribute10
MYRESOURCE_MAXIDLEEnvironment VariablemaxIdle Attribute2
MYRESOURCE_MAXWAITEnvironment VariablemaxWait Attribute2000

To configure Parameters, set the below environment variables for each Parameter, replacing MYPARAM with an identifier.

NameValueMandatory
PARAM_MYPARAM_NAMEParameter nameYes
PARAM_MYPARAM_VALUEParameter valueYes
PARAM_MYPARAM_DESCRIPTIONParameter descriptionNo
PARAM_MYPARAM_NAMEParameter nameNo

To configure the Tomcat Manger application, set the below environment variables and secrets. Omitting the TOMCAT_ADMIN environment variable will disable the admin user.

NameTypeValue
TOMCAT_ADMINEnvironment VariableTomcat manager username
tomcat_passDocker secretTomcat manager password

Copyright 2017 Australian Government Department of the Environment and Energy
[email protected]

tomcat-jdbc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

tomcat-jdbc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with tomcat-jdbc. If not, see http://www.gnu.org/licenses/.

Tag summary

Content type

Image

Digest

Size

193.5 MB

Last updated

almost 9 years ago

docker pull envris/tomcat-jdbc:7-jre7