-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.new
35 lines (24 loc) · 1.11 KB
/
Dockerfile.new
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
32
33
34
35
FROM maven:3-eclipse-temurin-17@sha256:7033f6a6b2db51e37e6f2a7a6f02795aa2a33df8a978252010408d76060e87b8 AS builder
COPY . .
RUN echo "<settings>\n" \
"<servers>\n" \
"<server>\n" \
"<id>\${repositoryOnboarding}</id>\n" \
"<username>\${repoLogin}</username>\n" \
"<password>\${repoPwd}</password>\n" \
"</server>\n" \
"</servers>\n" \
"</settings>\n" > settings.xml
ARG REPO_ONBOARDING
ARG REPO_USERNAME
ARG REPO_PASSWORD
RUN mvn --global-settings settings.xml -DrepositoryOnboarding=${REPO_ONBOARDING} -DrepoLogin=${REPO_USERNAME} -DrepoPwd=${REPO_PASSWORD} clean package -DskipTests=true
FROM openjdk:17-jdk@sha256:528707081fdb9562eb819128a9f85ae7fe000e2fbaeaf9f87662e7b3f38cb7d8 AS runtime
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
WORKDIR /app
COPY --from=builder ./target/*.jar ./app.jar
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.2.11/applicationinsights-agent-3.2.11.jar ./applicationinsights-agent.jar
RUN chmod 755 ./applicationinsights-agent.jar
EXPOSE 8080
USER 1001
ENTRYPOINT ["java", "-jar", "app.jar"]