lastbackend/tomcat

By lastbackend

Updated about 9 years ago

Image

423

lb-docker-tomcat

Base docker image to run a Tomcat application server

Usage

To create the image lastbackend/tomcat, execute the following command on the lb-docker-tomcat folder:

docker build -t lastbackend/tomcat .

To run the image and bind to port :

docker run -d -p 8080:8080 --name=tomcat lastbackend/tomcat

The first time that you run your container, a new random password will be set. To get the password, check the logs of the container by running:

docker logs <CONTAINER_ID>

You will see an output like the following:

------------------------------- TOMCAT -----------------------------
  +-++-+ admin:XFW5bkC8oADB0sJIB4awDupQ
  | LB |
  +-++-+ Please remember to change the above password!
--------------------------------------------------------------------

In this case, XFW5bkC8oADB0sJIB4awDupQ is the password allocated to the admin user.

You can now login to you admin console to configure your tomcat server:

http://127.0.0.1:8080/manager/html
http://127.0.0.1:8080/host-manager/html

Setting a specific password

If you want to use a preset password instead of a random generated one, you can set the environment variable PASS to your specific password when running the container:

docker run -d -p 8080:8080 -e PASS="mypass" lastbackend/tomcat

------------------------------ TOMCAT -----------------------------
  +-++-+
  | LB | <user>:<mypass>
  +-++-+
--------------------------------------------------------------------

If you want to disable password authentication, you can set PASS to **None**

You can now test your deployment:

http://127.0.0.1:8080/

by http://www.lastbackend.com

Docker Pull Command

docker pull lastbackend/tomcat