-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.ubuntu.evil
More file actions
31 lines (25 loc) · 1.36 KB
/
Dockerfile.ubuntu.evil
File metadata and controls
31 lines (25 loc) · 1.36 KB
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
31
# Note how we are using Ubuntu latest. This will change unexpectedly when there is a new LTS.
FROM ubuntu:latest
# We could make this worse by hard coding the version in the wget command.
ENV TOMCAT_VERSION 8.0.53
# Install updates, requirements, and clean up in multiple runs
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
# Note how this is multiple RUNs!!!
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
RUN tar xzvf /tmp/tomcat.tgz -C /opt
RUN mv /opt/apache-tomcat-${TOMCAT_VERSION} /opt/tomcat
# These deletes don't remove the files from prior layers we have two copies of tomcat, and one of the tar file.
# For even more layers we could chmod or chown the files.
RUN rm /tmp/tomcat.tgz
RUN rm -rf /opt/tomcat/webapps/examples
RUN rm -rf /opt/tomcat/webapps/docs
RUN rm -rf /opt/tomcat/webapps/ROOT
COPY src/sample.war /opt/tomcat/webapps/ROOT.war
# For even more layers we could chmod and then chown the war file. Remember that COPY can do this for you.
# An entrypoint means arguments to a docker command are taken as args to the entrypoint script!!! Not a different command and it's args.
ENTRYPOINT [ "/opt/tomcat/bin/catalina.sh”, “run”]