-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmbnd_pro1_dockerfile
More file actions
28 lines (27 loc) · 1022 Bytes
/
cmbnd_pro1_dockerfile
File metadata and controls
28 lines (27 loc) · 1022 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
FROM alpine as stage1
WORKDIR /mavn
COPY . .
ADD https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz /mavn
RUN apk add --no-cache openjdk11-jre tar \
&& tar -xzvf /mavn/apache-maven-3.9.6-bin.tar.gz -C /mavn \
&& mv /mavn/apache-maven-3.9.6 /mavn/maven \
&& mv /mavn/settings.xml /mavn/maven/conf \
&& chmod 700 -R /mavn/maven \
&& export PATH=$PATH:/mavn/maven/bin/ \
&& mvn clean validate \
&& mvn clean compile \
&& mvn clean test \
&& mvn clean package \
&& mvn clean deploy
FROM alpine
WORKDIR /app
ADD https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.98/bin/apache-tomcat-8.5.98.zip /app
RUN apk add --no-cache openjdk11-jre \
&& unzip apache-tomcat-8.5.98 -d /app \
&& mv /app/apache-tomcat-8.5.98 /app/tomcat \
&& chmod 700 -R /app/tomcat/ \
&& chmod u+x /app/tomcat/bin/*.sh
COPY --from=stage1 /mavn/target/java-web-app*.war /app/tomcat/webapps/java-web-app.war
EXPOSE 8080
CMD ["/app/tomcat/bin/catalina.sh", "run"]
#in line 21, the '-d' flag was not placed and it's a blunder