Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY jdtls-bin-override/jdtls.py /jdtls/bin/jdtls.py

FROM registry.access.redhat.com/ubi9/ubi AS maven-index
COPY hack/maven.default.index /maven.default.index

FROM registry.access.redhat.com/ubi9/ubi AS fernflower
RUN dnf install -y maven-openjdk17 wget --setopt=install_weak_deps=False && dnf clean all && rm -rf /var/cache/dnf
RUN wget --quiet https://github.com/JetBrains/intellij-community/archive/refs/tags/idea/231.9011.34.tar.gz -O intellij-community.tar && tar xf intellij-community.tar intellij-community-idea-231.9011.34/plugins/java-decompiler/engine && rm -rf intellij-community.tar
Expand All @@ -24,6 +25,12 @@ COPY ./ /app/
RUN export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
RUN JAVA_HOME=/usr/lib/jvm/java-17-openjdk mvn clean install -DskipTests=true

FROM registry.access.redhat.com/ubi9/ubi-minimal AS index-download
RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
Comment on lines +29 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Install unzip before using it.

The new stage invokes unzip, but UBI’s zip package does not ship the unzip binary, so this layer fails during the build. Install unzip (or both zip unzip) before running the command.

-RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
+RUN microdnf install -y wget unzip && microdnf clean all && rm -rf /var/cache/dnf
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN microdnf install -y wget zip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
RUN microdnf install -y wget unzip && microdnf clean all && rm -rf /var/cache/dnf
WORKDIR /maven-index-data
#TODO: get latest release when we get to update them periodically
RUN wget --quiet https://github.com/konveyor/maven-search-index/releases/download/v0.0.1/maven-index-data-v0.0.1.zip -O maven-index-data.zip && unzip maven-index-data.zip && rm maven-index-data.zip
🤖 Prompt for AI Agents
In Dockerfile around lines 29 to 32, the RUN uses the unzip binary but only
installs the zip package (which on UBI doesn't provide unzip); update the RUN
that currently does "microdnf install -y wget zip ..." to include unzip (e.g.,
microdnf install -y wget zip unzip ...) so the unzip command is available, keep
the subsequent microdnf clean and rm -rf /var/cache/dnf as-is to avoid leaving
package cache.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we keep this up to date are there going to be version bumps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have version bumps yeah, but for the moment we are going to stick to the current version. We can grab the latest version and hardcoded here or pass it through an argument in the future.


FROM registry.access.redhat.com/ubi9/ubi-minimal
# Java 1.8 is required for backwards compatibility with older versions of Gradle
RUN microdnf install -y python39 java-1.8.0-openjdk-devel java-17-openjdk-devel tar gzip zip --nodocs --setopt=install_weak_deps=0 && microdnf clean all && rm -rf /var/cache/dnf
Expand All @@ -45,5 +52,8 @@ COPY --from=jdtls-download /jdtls /jdtls/
COPY --from=addon-build /root/.m2/repository/io/konveyor/tackle/java-analyzer-bundle.core/1.0.0-SNAPSHOT/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/
COPY --from=fernflower /output/fernflower.jar /bin/fernflower.jar
COPY --from=maven-index /maven.default.index /usr/local/etc/maven.default.index
COPY --from=index-download /maven-index-data/central.archive-metadata.txt /usr/local/etc/maven-index.txt
COPY --from=index-download /maven-index-data/central.archive-metadata.idx /usr/local/etc/maven-index.idx

RUN ln -sf /root/.m2 /.m2 && chgrp -R 0 /root && chmod -R g=u /root
CMD [ "/jdtls/bin/jdtls" ]