Skip to content

Instantly share code, notes, and snippets.

@kevana
Last active August 29, 2015 14:22
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 kevana/46217b4c49ad56c1693c to your computer and use it in GitHub Desktop.
Save kevana/46217b4c49ad56c1693c to your computer and use it in GitHub Desktop.
One of the first Dockerfiles we wrote, don't do this.
FROM ubuntu:14.04
MAINTAINER ***********
#Update package respository
RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ precise-security main universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y python-software-properties
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:webupd8team/java
#Automatically accept oracle-license
RUN echo oracle-java6-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
# //Installing java6
RUN apt-get update
RUN apt-get install -y oracle-java6-installer && apt-get clean
RUN update-alternatives --display java
RUN echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >>/etc/environment
RUN echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >>/etc/default/tomcat6
COPY configuration/jssecacerts /usr/lib/jvm/java-6-oracle/jre/lib/security/
# //Installing apache
RUN apt-get update
RUN apt-get install -y apache2
RUN a2enmod proxy*
RUN a2enmod xml2enc
RUN a2enmod rewrite
RUN a2enmod ssl
RUN a2dissite 000-default
# Set the timezone
RUN echo "America/Chicago" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
# //Installing tomcat6 and changing ownership
RUN useradd -s /usr/sbin/nologin tomcat6
RUN apt-get install -y vim wget curl sudo
RUN wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.43/bin/apache-tomcat-6.0.43.tar.gz
RUN tar xvzf apache-tomcat-6.0.43.tar.gz && mv apache-tomcat-6.0.43 /opt/ && chown -R tomcat6:tomcat6 /opt/apache-tomcat-6.0.43/ && ln -s /opt/apache-tomcat-6.0.43 /opt/tomcat6
ENV JAVA_OPTS -Xms512m -Xmx1024m -XX:MaxPermSize=1204m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
COPY configuration/catalina.properties /opt/tomcat6/conf/
COPY configuration/web.xml /opt/tomcat6/conf/
COPY configuration/libs/*.jar /opt/tomcat6/lib/
FROM ubuntu:14.04
MAINTAINER ***********
#Automatically accept oracle-license
RUN echo oracle-java6-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
# Set the debconf frontend to Noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Set the timezone
RUN echo "America/Chicago" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
#Update package respository
RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ precise-security main universe" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y python-software-properties=0.92.37.3 \
software-properties-common=0.92.37.3 \
wget=1.15-1ubuntu1.14.04.1 \
apt-transport-https=1.0.1ubuntu2.8 \
vim=2:7.4.052-1ubuntu3 \
curl=7.35.0-1ubuntu2.5 \
sudo=1.8.9p5-1ubuntu1.1 && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java6-installer=6u45-0~webupd8~8 && \
apt-get clean autoclean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#Installing java6
RUN update-alternatives --display java
RUN echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >>/etc/environment && \
echo "JAVA_HOME=/usr/lib/jvm/java-6-oracle" >>/etc/default/tomcat6
COPY configuration/jssecacerts /usr/lib/jvm/java-6-oracle/jre/lib/security/
# Install Nginx
# Download certificate and key from the customer portal https://cs.nginx.com
# and copy to the build context
COPY nginx-repo.crt /etc/ssl/nginx/
COPY nginx-repo.key /etc/ssl/nginx/
# Get other files required for installation
RUN wget -q -O /etc/ssl/nginx/CA.crt https://cs.nginx.com/static/files/CA.crt && \
wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add - && \
wget -q -O /etc/apt/apt.conf.d/90nginx https://cs.nginx.com/static/files/90nginx && \
printf "deb https://plus-pkgs.nginx.com/ubuntu `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
# Install NGINX Plus
RUN apt-get update && \
apt-get install -y nginx-plus=1.7.11-2~trusty && \
apt-get clean autoclean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# forward request logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
# Installing tomcat6 and changing ownership
RUN useradd -s /usr/sbin/nologin tomcat6
RUN wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.43/bin/apache-tomcat-6.0.43.tar.gz && \
tar xvzf apache-tomcat-6.0.43.tar.gz && \
rm -rf apache-tomcat-6.0.43.tar.gz && \
mv apache-tomcat-6.0.43 /opt/ && \
chown -R tomcat6:tomcat6 /opt/apache-tomcat-6.0.43/ && \
ln -s /opt/apache-tomcat-6.0.43 /opt/tomcat6
ENV JAVA_OPTS -Xms512m -Xmx1024m -XX:MaxPermSize=1204m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
COPY configuration/catalina.properties /opt/tomcat6/conf/
COPY configuration/web.xml /opt/tomcat6/conf/
COPY configuration/libs/*.jar /opt/tomcat6/lib/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment