Sign inSign up

ladybird/c7-tomcat

By ladybird

•Updated over 8 years ago

CentOS 7 + Java 8 + Tomcat 8

Image
1

10K+

ladybird/c7-tomcat repository overview

Docker container featuring: CentOS 7 + Java 8 + Tomcat 8

⁠How to use

Put your WAR projects under /opt/tomcat/webapps directory (or any other as long as you make certain to adjust the values accordingly) and run the following command

# Setting some variables (directories must exist)
_EXPOSED_PORT=80;             # The local forwarded port
_TOMCAT_BASE_DIR=/opt/tomcat; # The tomcat's local root directory
_TOMCAT_WEBAPPS_DIR=webapps;  # The tomcat's local webapps directory
_TOMCAT_LOGS_DIR=logs;        # The tomcat's local log directory

# Creating the base directories if they do not exist -- they should by now if you have added a war project to the tomcat's webapps...
mkdir -p ${_TOMCAT_BASE_DIR}/${_TOMCAT_WEBAPPS_DIR} && mkdir -p ${_TOMCAT_BASE_DIR}/${_TOMCAT_LOGS_DIR}

# The docker run command
docker run \
  -p ${_EXPOSED_PORT}:8080 \
  -v ${_TOMCAT_BASE_DIR}/${_TOMCAT_WEBAPPS_DIR}:/opt/tomcat/webapps \
  -v ${_TOMCAT_BASE_DIR}/${_TOMCAT_LOGS_DIR}:/opt/tomcat/logs \
  -it --name c7-tomcat ladybird/c7-tomcat

Once you run it, you can start the container with docker start c7-tomcat in next time and log file will be under the /opt/tomcat/logs directory.

Also, if you got some error, you can remove the container with docker rm c7-tomcat. Your current container list will be show with docker ps -a.

For Mac users, you must share the directory /opt/tomcat/webapps and /opt/tomcat/logs on Docker > Preferences > File Sharing.

⁠Versions

If you get errors building image, please check the latest version of Java and Tomcat and ajust accordingly.

SoftwareVersionNote
CentOS7
Java8u151Java Release Note⁠
Apache Tomcat8.5.24Tomcat Download Page⁠

Docker Official Image for Tomcat⁠ is also available.

Tag summary

Content type

Image

Digest

Size

306.5 MB

Last updated

over 8 years ago

docker pull ladybird/c7-tomcat