I want to know whether if there is any method to remove the ROOT folder within the tomcat /webapps folder after its being deployed by a Docker image.
The reason that I want to achieve this is that I want to run my .war file as the root. I have already renamed my war file as ROOT.war. But when I run my Docker image with the tomcat base image, a ROOT folder is also created by default within the container's tomcat/webapps folder which doesn't allow me to access my ROOT.war file as the root.
My Dockerfile
# Pull base image
FROM tomcat:8.0.30-jre7
# Copy to images tomcat path
COPY /ROOT.war /usr/local/tomcat/webapps/
You can get the basic information about your Docker configuration by executing: $ docker info ... Storage Driver: overlay2 Docker Root Dir: /var/lib/docker ... The output contains information about your storage driver and your docker root directory.
Sure. You can just delete the already existing ROOT folder as part of your Dockerfile:
# Pull base image
FROM tomcat:8.0.30-jre7
# Delete existing ROOT folder
RUN rm -rf /usr/local/tomcat/webapps/ROOT
# Copy to images tomcat path
COPY ROOT.war /usr/local/tomcat/webapps/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With