Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find the tomcat folder in the docker image

I'm using ubuntu and I have installed Docker and started my first tutorial using Tomcat.

I made a docker file named Dockerfile that contains

FROM tomcat:7-jre7
MAINTAINER "Craig Trim <[email protected]>"

Then I build the image using

sudo docker build -t craig/tomcat .

and finally I started Tomcat:

sudo docker run -p 8080:8080 craig/tomcat

Now in the console, it shows that Tomcat is installed somewhere in /usr/local/tomcat

4-Nov-2016 10:36:57.031 INFO [localhost-startStop-1]   org.apache.catalina.startup.HostConfig.deployDirectory Deploying web     application directory /usr/local/tomcat/webapps/host-manager

But when I go there I did not find the folder tomcat. Where to find that folder, so that I can configure some files?

like image 278
BenMansourNizar Avatar asked Nov 04 '16 10:11

BenMansourNizar


People also ask

Where is Docker file located?

If you use the default storage driver overlay2, then your Docker images are stored in /var/lib/docker/overlay2 . There, you can find different files that represent read-only layers of a Docker image and a layer on top of it that contains your changes.

How do I start Tomcat in debug mode in Docker?

Open the run/debug configuration window. Then click + and select remote. Now add the host and JPDA port and click apply. Finally click the debug icon then you will be able to debug you application.


1 Answers

I ran the apache container in the background (-d):

docker run -d -p 8080:8080 tomcat:7-jre7

I checked if the container was running

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                    NAMES
c2ca0d66536c        tomcat:7-jre7       "catalina.sh run"   9 minutes ago       Up 9 minutes        0.0.0.0:8080->8080/tcp   focused_bell

I went 'inside' the container using its container ID:

docker exec -it c2ca0d66536c bash
root@c2ca0d66536c:/usr/local/tomcat#

Now I'm able to go inside the application directory /usr/local/tomcat/webapps/host-manager :

root@c2ca0d66536c:/usr/local/tomcat# cd webapps/host-manager/
root@c2ca0d66536c:/usr/local/tomcat/webapps/host-manager# ls
META-INF  WEB-INF  images  index.jsp  manager.xml

I hope this was your question? Because it was not very clear for me. If it wasn't I'll delete or edit the answer. I think your 'problem' was the fact you're running the container in the foreground.

like image 180
lvthillo Avatar answered Nov 15 '22 11:11

lvthillo