Write Apache Tomcat Dockerfile for Ubuntu 20.04 LTS - TechBeginner

Welcome to TechBeginner.in, Tech Beginner provides technical blog for Online Linux Tutorials, Ubuntu Tutorials, Redhat Tutorials and CentOS 7, Configuration of server like Web Server, Application server, Database server, Window server, networking, html, css, java script, php, wordpress, opencart, magento, joomla and etc.

Write Apache Tomcat Dockerfile for Ubuntu 20.04 LTS

Share This

Apache Tomcat is a open source Java servlet container and in this post we will write the Apache Tomcat Docker file. 

FROM ubuntu:latest
RUN apt-get update -y && apt-get install default-jdk -y
RUN groupadd tomcat
RUN useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
RUN cd /tmp && apt-get install curl -y
RUN curl -O http://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.46/bin/apache-tomcat-8.5.46.tar.gz
RUN mkdir /opt/tomcat && cd /opt/tomcat
RUN chgrp -R tomcat /opt/tomcat
RUN chmod -R g+r conf
RUN chmod g+x conf
RUN chown -R tomcat webapps/ work/ temp/ logs/
CMD /opt/tomcat/bin/startup.sh run

To build the docker image use the following command for the same.

docker build . -t mytomcat:v1

No comments:

Post a Comment