Last active
May 15, 2017 19:30
-
-
Save adilsonbna/4a6f7393562a6250d1087b92a9929658 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
MAINTAINER Adilson Cesar <[email protected]> | |
# Expose Web Port | |
EXPOSE 8080 | |
# Set environment | |
ENV JAVA_HOME /opt/jdk | |
ENV PATH ${PATH}:${JAVA_HOME}/bin | |
ENV JAVA_PACKAGE server-jre | |
ENV TOMCAT_VERSION_MAJOR 8 | |
ENV TOMCAT_VERSION_FULL 8.5.14 | |
ENV CATALINA_HOME /opt/tomcat | |
# Download and install Java | |
RUN apk --update add openjdk8-jre &&\ | |
mkdir -p /opt/jdk &&\ | |
ln -s /usr/lib/jvm/java-1.8-openjdk/bin /opt/jdk | |
# Download and install Tomcat | |
RUN apk add --update curl &&\ | |
curl -LO https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_VERSION_MAJOR}/v${TOMCAT_VERSION_FULL}/bin/apache-tomcat-${TOMCAT_VERSION_FULL}.tar.gz &&\ | |
curl -LO https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_VERSION_MAJOR}/v${TOMCAT_VERSION_FULL}/bin/apache-tomcat-${TOMCAT_VERSION_FULL}.tar.gz.md5 &&\ | |
md5sum -c apache-tomcat-${TOMCAT_VERSION_FULL}.tar.gz.md5 &&\ | |
gunzip -c apache-tomcat-${TOMCAT_VERSION_FULL}.tar.gz | tar -xf - -C /opt &&\ | |
rm -f apache-tomcat-${TOMCAT_VERSION_FULL}.tar.gz apache-tomcat-${TOMCAT_VERSION_FULL}.tar.gz.md5 &&\ | |
ln -s /opt/apache-tomcat-${TOMCAT_VERSION_FULL} /opt/tomcat &&\ | |
rm -rf /opt/tomcat/webapps/examples /opt/tomcat/webapps/docs &&\ | |
apk del curl &&\ | |
rm -rf /var/cache/apk/* | |
# Launch Tomcat on startup | |
CMD ${CATALINA_HOME}/bin/catalina.sh run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment