-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (30 loc) · 1003 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
ARG VERSION=dev
ARG BUILD_NUMBER=n.a.
ARG GIT_REV=n.a.
# compile and test bambi
FROM amazoncorretto:11-alpine-jdk as java-builder
ARG VERSION
ARG BUILD_NUMBER
ARG GIT_REV
COPY [".git", "/work/.git"]
COPY ["src", "/work/src"]
COPY ["gradle", "/work/gradle"]
COPY ["build.gradle", "settings.gradle", "gradle.properties", "gradlew", "/work/"]
RUN apk add --no-cache dos2unix
WORKDIR /work
RUN dos2unix gradlew
RUN ./gradlew -i build fatJar -PprojectVersion=${VERSION} -PbuildNumber=${BUILD_NUMBER} --no-daemon
# create final image
FROM amazoncorretto:11-alpine-jdk
ARG VERSION
ARG BUILD_NUMBER
ARG GIT_REV
ENV VERSION=${VERSION}
ENV BUILD_NUMBER=${BUILD_NUMBER}
ENV GIT_REV=${GIT_REV}
RUN /usr/sbin/addgroup -S cip4 && /usr/sbin/adduser -S cip4 -G cip4
COPY --chown=cip4:cip4 --from=java-builder ["/work/build/libs/*-fat-${VERSION}.jar", "/app/jdfutility.jar"]
USER cip4
WORKDIR /home/cip4
EXPOSE 8080
ENTRYPOINT ["java", "-cp","/app/jdfutility.jar", "org.cip4.jdfutility.exe.CheckJDFServer"]