How to access War File Build deployed in Tomcat Docker Container after deleting root

my docker file:

FROM tomcat

MAINTAINER "Shan Khan <">

RUN ["rm", "-rf", "/usr/local/tomcat/webapps/ROOT"]

COPY ROOT.war /usr/local/tomcat/webapps/

CMD ["/usr/local/tomcat/bin/", "run"]

running as:

  • “ECONNREFUSED” while connecting to docker mysql container in NodeJS application
  • Dokku server hosts two sites with TLD's, both domains are landing on only one app
  • log_driver param doesn't work on ansible 2.0
  • Kafka in Kubernetes Cluster- How to publish/consume messages from outside of Kubernetes Cluster
  • docker COPY not working when deploying with docker-machine
  • net_adm:ping from one container to another
  • sudo docker build -t webserver
    sudo docker run -it --rm -p 8080:8080 webserver

    tomcat is running but im unable to access in the localhost:8080 or localhost:8080/ROOT

  • Docker + Nodejs + Private Repo + Private NPM Module - Access Problems
  • Docker Swarm : How to setup multiple containers on same volume
  • Error :Could not connect to Redis at redis:6379: Name or service not known
  • Docker and Magento permission issues
  • How can I enable MySQL binary logging using the official Docker image?
  • architechtetural thoughts about dockerizing the exsting services
  • 2 Solutions collect form web for “How to access War File Build deployed in Tomcat Docker Container after deleting root”

    When I was doing this for a work project I seem to remember having to deploy the app to the Tomcat root.

    Deploying my application at the root in Tomcat

    So basically you would need to add some steps to your Dockerfile to accomplish this.

    instead of using CMD ["/usr/local/tomcat/bin/", "run"], try to do it as ENTRYPOINT ["/usr/local/tomcat/bin/", "run"]

    If this do not resolve your problem, try to see the logs. In the logs you will see something like deploying webapp ROOT. If you do not see this logs but you get server startup took ***ms, then try to check war file locally or see if there are some errors popping up in catalina.out file inside logs folder by connecting to the docker container. (docker ps- command to check the docker container running your dockerfile)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.