Where to find the tomcat folder in the docker image

13,082

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.

Share:
13,082
BenMansourNizar
Author by

BenMansourNizar

Senior Java/J2EE Developper

Updated on June 07, 2022

Comments

  • BenMansourNizar
    BenMansourNizar almost 2 years

    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?