-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.evil
More file actions
30 lines (25 loc) · 1015 Bytes
/
Dockerfile.evil
File metadata and controls
30 lines (25 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM ubuntu:latest
ENV TOMCAT_VERSION 8.0.53
# Update Debs
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install openjdk-8-jdk wget
RUN apt-get clean
RUN rm -r /var/lib/apt/lists/*
RUN mkdir /usr/local/tomcat
# Install Tomcat
RUN wget --quiet --no-cookies https://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz -O /tmp/tomcat.tgz
# Creates layer with files in opt/apache-tomcat-${TOMCAT_VERSION}
RUN tar xzvf /tmp/tomcat.tgz -C /opt
# Creates layer with files in /opt/tomcat
RUN mv /opt/apache-tomcat-${TOMCAT_VERSION} /opt/tomcat
# Pointless as the file still exists in prior layer
RUN rm /tmp/tomcat.tgz
# All of the these deletes are pointless to save space.
RUN rm -rf /opt/tomcat/webapps/examples
RUN rm -rf /opt/tomcat/webapps/docs
RUN rm -rf /opt/tomcat/webapps/ROOT
# Copy war from local filesystem
COPY src/sample.war /opt/tomcat/webapps/ROOT.war
# Add entry point
ENTRYPOINT [ "/opt/tomcat/bin/catalina.sh”, “run”]