1
- FROM openjdk:21-slim AS build-stage
1
+ FROM ubuntu:noble AS build-stage
2
2
3
- # Compiles gumtree
3
+ ARG TARGETARCH
4
+ ARG DEBIAN_FRONTEND=noninteractive
5
+ ENV TZ=GMT
6
+ ENV LANG=C.UTF-8
7
+
8
+ # Install all dependencies
9
+ RUN apt-get update \
10
+ && apt-get install -y --no-install-recommends openjdk-17-jdk-headless wget && \
11
+ if [ "${TARGETARCH}" = "arm64" ]; then \
12
+ wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.10_arm64.deb && \
13
+ apt install -y --no-install-recommends ./srcml_1.1.0-1_ubuntu24.10_arm64.deb; \
14
+ else \
15
+ wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.04_amd64.deb && \
16
+ apt install -y --no-install-recommends ./srcml_1.1.0-1_ubuntu24.04_amd64.deb; \
17
+ fi
18
+
19
+ # Compile gumtree
4
20
COPY . /opt/gumtree
5
- RUN /opt/gumtree/gradlew -p /opt/gumtree build
21
+ RUN /opt/gumtree/gradlew -PtestExternal -p /opt/gumtree build
22
+
23
+ FROM ubuntu:noble AS final-stage
24
+
25
+ ARG TARGETARCH
26
+ ARG DEBIAN_FRONTEND=noninteractive
27
+ ENV TZ=GMT
28
+ ENV LANG=C.UTF-8
6
29
7
- FROM openjdk:21-slim AS final-stage
30
+ # Copy gumtree distribution from build-stage.
31
+ COPY --from=build-stage /opt/gumtree/dist/build/install/gumtree/ /opt/gumtree
32
+ # Copy srcml package from build-stage.
33
+ COPY --from=build-stage /*.deb /opt
8
34
9
- # Copy gumtree-native distribution from build-stage.
10
- COPY --from=build-stage /opt/gumtree/dist-minimal/build/install/gumtree/ /opt/gumtree
35
+ # Install all dependencies
36
+ RUN apt-get update && \
37
+ apt-get install -y --no-install-recommends openjdk-17-jre-headless && \
38
+ if [ "${TARGETARCH}" = "arm64" ]; then \
39
+ apt install -y --no-install-recommends /opt/srcml_1.1.0-1_ubuntu24.10_arm64.deb; \
40
+ else \
41
+ apt install -y --no-install-recommends /opt/srcml_1.1.0-1_ubuntu24.04_amd64.deb; \
42
+ fi && \
43
+ rm -rf /var/cache/apt/archives /var/lib/apt/lists/*. /opt/*.deb && \
44
+ mkdir -p /left /right
11
45
12
- # Define volume diff to make available files to diff
13
- RUN mkdir -p /diff/left /diff/right
14
- WORKDIR /diff
15
- VOLUME /diff/left /diff/right
46
+ VOLUME /left /right
16
47
17
48
# Expose port 4567 for webdiff
18
49
EXPOSE 4567
19
50
20
- ENTRYPOINT ["/opt/gumtree/bin/gumtree" ]
51
+ ENTRYPOINT ["/opt/gumtree/bin/gumtree" ]
0 commit comments