Skip to content

Instantly share code, notes, and snippets.

@KazChe
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KazChe/540045d212c14dee5b73 to your computer and use it in GitHub Desktop.
Save KazChe/540045d212c14dee5b73 to your computer and use it in GitHub Desktop.
FROM centos:centos6
#Install WGET
RUN yum install -y wget
#Install tar
RUN yum install -y tar
# Download JDK
RUN cd /opt;wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz; pwd
RUN cd /opt;tar xvf jdk-7u55-linux-x64.tar.gz
RUN alternatives --install /usr/bin/java java /opt/jdk1.7.55/bin/java 2
# Download Apache Tomcat 7
RUN cd /tmp;wget http://apache.mirrors.pair.com/tomcat/tomcat-7/v7.0.61/bin/apache-tomcat-7.0.61.tar.gz
# untar and move to proper location
RUN cd /tmp;tar xvf apache-tomcat-7.0.61.tar.gz
RUN cd /tmp;mv apache-tomcat-7.0.61 /opt/tomcat7
RUN chmod -R 755 /opt/tomcat7
# you can set environment variables
ENV JAVA_HOME /opt/jdk1.7.0_55
# default port to expose when container run
EXPOSE 8080
# start Tomcat
CMD /opt/tomcat7/bin/catalina.sh run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment