I'm trying to deploy .war,.aar,.xml and .properties file to tomcat docker container. I have used below Dockerfile with the base tomcat docker image.
FROM tomcat:7
RUN rm -rf /usr/local/tomcat/webapps/ROOT
COPY test-3.0.war /usr/local/tomcat/webapps/ROOT.war
COPY testone-3.0.aar /usr/local/tomcat/webapps/axis2/WEB-INF/services/
COPY ./conf/context.xml /usr/local/tomcat/conf/
COPY ./conf/server.xml /usr/local/tomcat/conf/
CMD ["catalina.sh", "run"]
Everything works as expected till now. It extracts the war file and starts the application inside the container.
But now i need to add/edit some of the property files inside "/usr/local/tomcat/webapps/ROOT/WEB-INF/classes/" and "/usr/local/tomcat/webapps/ROOT/js" Like this.
COPY ./conf/applicationurl.properties /usr/local/tomcat/webapps/ROOT/WEBINF/classes/
COPY ./conf/memcache.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/
COPY ./conf/um.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/
COPY ./conf/pe.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/
COPY ./conf/check.js /usr/local/tomcat/webapps/ROOT/js
What is the best approach to copy these files in to a running tomcat container ? I tried to build one more docker image with the above Dockerfile as a base image and copied aforementioned files in to a destination folder inside container but it deletes all the extracted war folder/files and it has only copied files inside /usr/local/tomcat/webapps directory.
I just need to add some of the property files and it shouldn't delete existing extracted folders inside webapps directory.
Can someone help me out with this?
WEB-INFetc, to add plugins such as mysql db plugin