- Based of Bitnami Tomcat 9.0/debian-10 debian-10.0.34-debian-10-r4
- Added JDK 1.8.242-0 instead of JDK 11.0.6-0
- Added Host Manager Roles and Manager Roles
- admin-script
- manager-script
- manager-jmx
- manager-status
- Added TOMCAT_ALLOW_REMOTE_MANAGEMENT_ANY_IP to Environment variables. Allow to connect to manager applications from ANY remote IP addresse. Valid values are 0 and 1. Default: 0
git clone git@github.com:bitnami/bitnami-docker-tomcat.git
cd bitnami-docker-tomcat
git checkout 8ee5c7c32ad71bc6287c68b304743f2c84964198
cd 9.0/debian-10
Install JDK 1.8 instead of JDK 11.0.6-0
Edit Dockerfile
FROM docker.io/bitnami/minideb:buster
# removed for brevity
# RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "java" "11.0.6-0" --checksum f7446f8bec72b6b2606d37ba917accc243e6cd4e722700c39ef83832c46fb0c6
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "java" "1.8.242-0" --checksum 3a70f3d1c3cd9bc6ec581b2a10373a2b323c0b9af40402ce8d19aeb0b3d02400
# removed for brevity
JDK package location: java-1.8.242-0-linux-amd64-debian-10.tar.gz
Edit bitnami-docker-tomcat/rootfs/opt/bitnami/scripts/libtomcat.sh
- add Tomcat Host Manager and Manager Roles:
admin-script
manager-script
manager-jmx
manager-status
# removed for brevity
tomcat_create_tomcat_user() {
local username=${1:?username is missing}
local password=${2:-}
local user_definition="<user username=\"${username}\" password=\"${password}\" roles=\"manager-gui,admin-gui,admin-script,manager-script,manager-jmx,manager-status\"/></tomcat-users>"
replace_in_file "$TOMCAT_USERS_CONF_FILE" "</tomcat-users>" "$user_definition"
}
# removed for brevity
Edit bitnami-docker-tomcat/rootfs/opt/bitnami/scripts/libtomcat.sh
# removed for brevity
tomcat_env() {
cat <<"EOF"
## Exposed
## removed
export TOMCAT_ALLOW_REMOTE_MANAGEMENT_ANY_IP="${TOMCAT_ALLOW_REMOTE_MANAGEMENT_ANY_IP:-0}"
EOF
}
# removed for brevity
# removed for brevity
tomcat_enable_remote_management() {
# removed for brevity
if is_boolean_yes "$TOMCAT_ALLOW_REMOTE_MANAGEMENT_ANY_IP"; then
inner_tag=""
else
inner_tag=$(tomcat_render_tag Valve "className=\"org.apache.catalina.valves.RemoteAddrValve\" allow=\"\\\d+\\\.\\\d+\\\.\\\d+\\\.\\\d+\"")
fi
# removed for brevity
}
# removed for brevity
docker login
docker run --name t9 -d --rm -p 8080:8080 -p 8443:8443 andriykalashnykov/bitnami-tomcat9-jdk18:latest
docker exec -t t9 sh -c "cat /opt/bitnami/tomcat/conf/server.xml"
docker exec -t t9 sh -c "cat /opt/bitnami/tomcat/logs/catalina.*.log | grep 'APR'"
docker exec -t t9 sh -c "cat /opt/bitnami/tomcat/conf/tomcat-users.xml | grep 'admin-script'"
docker exec -t t9 sh -c "curl http://localhost:8080/"
docker stop t9