File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,6 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1515 && apt-get clean \
1616 && rm -rf /var/lib/apt/lists/*
1717
18- # Set JAVA_HOME for Microsoft OpenJDK
19- ENV JAVA_HOME=/usr/lib/jvm/msopenjdk-17-amd64
20- ENV PATH="$JAVA_HOME/bin:$PATH"
21-
2218# Switch to vscode user for the build
2319USER vscode
2420
@@ -31,7 +27,10 @@ COPY --chown=vscode:vscode . ./
3127# Pre-populate Gradle cache by running assemble
3228# Use --no-daemon to avoid leaving daemon processes running
3329# Skip javadoc to speed up the build and avoid external dependency issues
34- RUN ./gradlew assemble -x javadoc --no-daemon
30+ # Set JAVA_HOME dynamically based on the actual installation
31+ RUN export JAVA_HOME=$(find /usr/lib/jvm -name "msopenjdk-17-*" -type d | head -1) && \
32+ export PATH="$JAVA_HOME/bin:$PATH" && \
33+ ./gradlew assemble -x javadoc --no-daemon
3534
3635# Clean up the build directory but preserve gradle cache
3736RUN rm -rf /tmp/build
You can’t perform that action at this time.
0 commit comments