-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (17 loc) · 680 Bytes
/
Dockerfile
File metadata and controls
27 lines (17 loc) · 680 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
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 .
COPY --chown=projects:projects . .
RUN ["mvn", "clean"]
RUN ["mvn", "de.qaware.maven:go-offline-maven-plugin:resolve-dependencies", "test", "-Dmaven.test.failure.ignore"]
RUN ["mvn", "clean"]
ENTRYPOINT ["sh"]