Docker Community Forums

Share and learn in the Docker community.

Docker Container : Logs are not Created in Tomcat's logs folder in Docker Container

docker

(Shriyashlakhe) #1

We are using Docker container and created a Dockerfile
Inside this container we deployed war file using tomcat image
and we can see tomcat logs at console but console logs is not updating
after sending a request to tomcat via URL.
Also we can not see any log file inside tomcat logs folder

Can anyone help me out that how we can see tomcat logs like localhost.logs/catalina.logs/manager.logs etc

MY Dockerfile is :-

FROM java

ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH

RUN mkdir -p "$CATALINA_HOME"
COPY  tomcat $CATALINA_HOME

ADD  newui.war  $CATALINA_HOME/webapps

CMD $CATALINA_HOME/bin/startup.sh && tail -f $CATALINA_HOME/logs/catalina.out

EXPOSE 8080

Used below script to build

docker build -t tomcat .

and below used to run tomcat

docker run -p 8080:8080 tomcat


(Sam) #2

what is the path you think is the logs folder?