-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
57 lines (42 loc) · 1.3 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
# syntax=docker/dockerfile:1
FROM alpine:3.15
# PACKAGE STAGE
# Prepare the compile environment. JDK is automatically installed
RUN apk add maven
# Create and navigate to a working directory
WORKDIR /home/user
COPY local-maven-repo ./local-maven-repo
# Copy the source code
COPY src ./src
# Copy the pom.xml if Maven is used
COPY pom.xml .
# Execute the maven package process
RUN mvn package || exit
FROM alpine:3.15
# Create a user
RUN adduser --disabled-password --home /home/sherlock --gecos '' sherlock
RUN apk add --no-cache --upgrade bash
RUN apk add --update openjdk17
# Change into the home directory
WORKDIR /home/sherlock
# Copy the compiled JAR file from the first stage into the second stage
# Syntax: COPY --from=STAGE_ID SOURCE_PATH TARGET_PATH
WORKDIR /home/sherlock/holmes
COPY --from=0 /home/user/target/diffdetective-*-jar-with-dependencies.jar ./DiffDetective.jar
WORKDIR /home/sherlock
RUN mkdir results
# Copy the setup
COPY docs holmes/docs
# Copy the docker resources
COPY docker/* ./
COPY replication/esecfse22/docker/* ./
RUN mkdir DiffDetectiveMining
# Adjust permissions
RUN chown sherlock:sherlock /home/sherlock -R
RUN chmod +x execute.sh
RUN chmod +x entrypoint.sh
RUN chmod +x fix-perms.sh
# Set the entrypoint
ENTRYPOINT ["./entrypoint.sh", "./execute.sh"]
# Set the user
USER sherlock