-1

I'm trying to run a simple Tomcat server. But I can't see the Tomcat default page.

1) I ran this command to run the container docker run -it --entrypoint bash e36658dffbd8

2) I opened up localhost:8080/ after installing tomcat8 in my container but it doesn't work.

Here is my Dockerfile

FROM ubuntu:16.04
# OS: Ubuntu 16.04

# Tomcat Setup
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64

RUN apt-get update
RUN apt-get install -y openjdk-8-jre-headless exuberant-ctags git telnet subversion mercurial wget inotify-tools unzip sysstat vim procps virtualenv python3-pip

EXPOSE 7443
EXPOSE 8080

2
  • 1
    Have you considered using one of the official tomcat docker images? – jordanm Jan 23 '20 at 22:24
  • No,,, it has to run it on ubuntu 16.04 – hellofanengineer Jan 23 '20 at 22:29
0

Edited After looking closely on your dockerfile, you are not installing tomcat, check this link to get started: https://gist.github.com/lobster1234/af2dc4eef3ee75117043d950c2c1ec2b

You would need to debug it a little further... First you need to run the container and map the ports: docker run -it -p 8080:8080 $container_name

than make sure that the firewall is disabled in the container, you can jump into the container with docker exec -it $container_name bash and run ufw disable another thing to do while you are inside the container is to check that the tomacat server is actually running...

with having saying that^ your docker file doesn't show that you are enabling tomcat as a service to run as default or calling a script that will run it ( i'm pretty sure that this is the issue)

If the tomcat server is running, you should see if there any errors in the tomcat logs that could point you to the issue

good luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.