- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (16 loc) · 617 Bytes
/
Dockerfile
File metadata and controls
25 lines (16 loc) · 617 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
FROM maven:3.6.3-jdk-11
WORKDIR /src/app/
# mvn needs a user.home in which to run as non-root
# https://hub.docker.com/_/maven , "Running as non-root"
# hence the mkdir and USER command later on
RUN ["mkdir", "/home/projects"]
RUN groupadd projects && useradd -g projects projects && \
chown -R projects:projects /src/app && \
chown -R projects:projects /home/projects
# needed for mvn, see above
USER projects
COPY --chown=projects:projects ./pom.xml .
RUN ["mvn", "clean"]
RUN ["mvn", "de.qaware.maven:go-offline-maven-plugin:resolve-dependencies"]
COPY --chown=projects:projects . .
ENTRYPOINT ["sh"]