- Initial release,

- Based on rx3-docker/java-1.1.4-mga9 image,
- Use Tomcat 9.0.111 from Mageia 9 RPM.
This commit is contained in:
2026-01-10 13:27:51 +01:00
commit 5cd74a347d
9 changed files with 244 additions and 0 deletions

52
Dockerfile Normal file
View File

@@ -0,0 +1,52 @@
# Rx3-Docker/Tomcat Dockerfile
#-------------------------------------------------------------------------------
ARG IMG_FROM_URL="rx3-docker/java:latest"
FROM ${IMG_FROM_URL}
ARG IMG_NAME
ARG IMG_NAME_FULL
ARG IMG_VERSION
ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
ARG TOMCAT_CONFIG_DIR=/etc/tomcat
ARG TOMCAT_CONFIG_FILE=${TOMCAT_CONFIG_DIR}/tomcat.conf
ARG TOMCAT_LIB_DIR=/var/lib/tomcat
ARG TOMCAT_LOG_DIR=/var/log/tomcat
ARG TOMCAT_PORT=8080
#---------------------------------------------------------------------------------------------------
ARG TOMCATD='#!/bin/bash \n\
\n\
usermod -u ${TOMCAT_UID} tomcat \n\
groupmod -g ${TOMCAT_GID} tomcat \n\
\n\
chown -R tomcat:tomcat '${TOMCAT_CONFIG_DIR}' '${TOMCAT_LIB_DIR}' '${TOMCAT_LOG_DIR}
#---------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------
ARG TOMCATD_INI='[program:tomcatd] \n\
command=bash -c "source '${TOMCAT_CONFIG_FILE}' && /usr/libexec/tomcat/server start" \n\
user=tomcat'
#---------------------------------------------------------------------------------------------------
RUN urpmi.update -a \
&& urpmi --force tomcat \
&& echo -e "${TOMCATD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/tomcatd \
&& chmod a+x /etc/init.d/tomcatd \
&& ln -s /etc/init.d/tomcatd /etc/rcD.d/S40tomcatd \
&& echo -e "${TOMCATD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/tomcatd.ini
EXPOSE ${TOMCAT_PORT}