Using docker-compose to deploy Tomcat server in Docker .
CATALINA_BASE: /usr/local/tomcat
CATALINA_HOME: /usr/local/tomcat
CATALINA_TMPDIR: /usr/local/tomcat/temp
JRE_HOME: /usr
CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
-
run
./build-image.sh
-
run
docker-compose up -d
Open your browser , and visit http://localhost:8080
-
open your browser and visit http://localhost:8080/countuser-1.0-SNAPSHOT/ , you can find something produced by j2ee .
use commonds to enter tomcat terminal :
docker exec -it 容器ID/容器name /bin/bash