# Use the official Tomcat 8.5.39 base image FROM tomcat:8.5.39-jre8 # FROM tomcat:8 RUN rm -fr /usr/local/tomcat/webapps/examples RUN mkdir -p /usr/local/tomcat/lib/additional ENV CLASSPATH /usr/local/tomcat/lib:/usr/local/tomcat/lib/additional # https://unix.stackexchange.com/questions/743839/apt-get-update-failed-to-fetch-debian-amd64-packages-while-building-dockerfile-f RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list RUN apt-get update && apt-get install -y mlocate RUN updatedb # # Set environment variables # ENV CATALINA_HOME /usr/local/tomcat # ENV PATH $CATALINA_HOME/bin:$PATH # RUN mv /usr/local/tomcat/webapps.dist/* /usr/local/tomcat/webapps/ # RUN apt-get update && apt-get install -y mlocate # # Copy your application war file to the webapps directory # COPY path/to/your/app.war $CATALINA_HOME/webapps/ # Expose the Tomcat port EXPOSE 8080 # Copy entrypoint script COPY scripts/entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] # Start Tomcat # CMD ["catalina.sh", "run"]