-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
76 lines (59 loc) · 1.92 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# syntax=docker/dockerfile:1
FROM openjdk:19-alpine
# Prepare the environment
RUN apk add maven git
WORKDIR /home/user
COPY local-maven-repo ./local-maven-repo
COPY src ./src
COPY pom.xml .
RUN mvn package || exit
FROM openjdk:19-alpine
ARG GROUP_ID
ARG USER_ID
# Create a user
RUN addgroup -g $GROUP_ID user
RUN adduser --disabled-password -G user -u $USER_ID --home /home/user --gecos '' user
# Prepare the environment
RUN apk update
RUN apk add git bash
ENV GOSU_VERSION 1.16
RUN set -eux; \
\
apk add --no-cache --virtual .gosu-deps \
ca-certificates \
dpkg \
gnupg \
; \
\
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
\
# verify the signature
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
command -v gpgconf && gpgconf --kill all || :; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
\
# clean up fetch dependencies
apk del --no-network .gosu-deps; \
\
chmod +x /usr/local/bin/gosu; \
# verify that the binary works
gosu --version; \
gosu nobody true
WORKDIR /home/user
# Copy JAR from previous stage
COPY --from=0 /home/user/target /home/user/target
RUN cp target/*Extraction-jar-with* .
# Copy required scripts and properties
COPY docker-resources/* /home/user/
RUN mkdir -p /home/user/src/main/resources
RUN mkdir -p /home/user/ground-truth/
# permissions for calculon
RUN chown user:user /home/user -R
RUN chmod +x entrypoint.sh
RUN chmod +x fix-perms.sh
RUN chmod +x extract.sh
ENTRYPOINT ["./entrypoint.sh", "./extract.sh"]