I am trying to package a war file using a tomcat Docker image. I'm trying to expose the tomcat port in the image for it to be accessed externally.
This is my docker file
FROM tomcat8:3.0.0
COPY target/hello-world-war-1.0.0.war /usr/local/tomcat/webapps
EXPOSE 8080
However, when I build this image, run it and try to access from my host browser (localhost:8080) it doesn't hit the endpoint, therefore it does not work as expected
I still have to expose the port externally with the -p switch.
What have I missed? or is the usage of EXPOSE something else?
My end need is to be able to deploy this in kubernetes.