Run war with tomcat in docker

I’ve followed these two post 1 & 2 and neither work. I’m currently building my tomcat with the below.

Build File

  • How do I get AWS credentials in the AWS ECS docker container?
  • Expose mongo port in other container
  • Using xdebug through Docker container in PhpStorm
  • How to convert a systemctl command to supervisord command
  • Installing Docker on CentOS 6.6
  • Vagrant start docker image on existing machine
  • FROM tomcat:8.0
    
    COPY server/build/libs/server.war /usr/local/tomcat/webapps/server.war
    
    CMD ["catalina.sh", "run"]
    

    Terminal

    docker build -t my_server .
    
    docker run -it -rm -p 8080:8080
    

    When I go to http:localhost:8080 I see the manager home page but http:localhost:8080/server or http:localhost:8080/server/webapp/do not show up. My terminal tells me that my war is getting added, but nothing that says it’s expanded

     INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /usr/local/tomcat/webapps/server.war has finished in 2,518 ms
    

  • Connecting IBM Containers (Dockers) to Watson IoT service instance
  • Docker won't publish selected ports
  • Cant build a docker dart-runtime image after a local pub-get
  • Is there a performance impact to having docker containers with different OS base boxes?
  • What permissions do I need to enable for Docker volumes to work?
  • What is the difference between running docker image in and outside of vagrant?
  • One Solution collect form web for “Run war with tomcat in docker”

    For removing the manager app, you need to put the following RUN command before you copy the WAR in DockerFile.

    RUN rm -rf /usr/local/tomcat/webapps/*

    The above command removes the default apps available in tomcat.

    Your application should be available at http:localhost:8080/server/

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