Skip to content

Commit 9eb8e52

Browse files
committed
feat: now only one container for all only 226MB!.
1 parent 63b7fad commit 9eb8e52

File tree

2 files changed

+42
-47
lines changed

2 files changed

+42
-47
lines changed

docker/Dockerfile

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,51 @@
1-
FROM openjdk:21-slim AS build-stage
1+
FROM ubuntu:noble AS build-stage
22

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
420
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
629

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
834

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
1145

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
1647

1748
# Expose port 4567 for webdiff
1849
EXPOSE 4567
1950

20-
ENTRYPOINT ["/opt/gumtree/bin/gumtree"]
51+
ENTRYPOINT ["/opt/gumtree/bin/gumtree"]

docker/Dockerfile-external

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)