-
Notifications
You must be signed in to change notification settings - Fork 726
/
Dockerfile
25 lines (16 loc) · 619 Bytes
/
Dockerfile
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-jdk-8-slim
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"]