-
Notifications
You must be signed in to change notification settings - Fork 1
NMS-19504: UBI10: Create the base deploy #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: variant/ubi10
Are you sure you want to change the base?
Changes from all commits
494dce4
aff989b
77aaafa
0a4a402
f10ce9b
8e39836
5e1b75a
e0a5c35
4c82f05
ef9e159
3b003c8
095aeb4
b2010b0
eb33a81
0491739
3ffaaa9
5b53346
6a730d1
e0eddca
916f5ad
1ee8703
623cf1e
b582e93
77959fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,18 +9,18 @@ FROM ${BASE_IMAGE} AS core | |||||||||||||||||
| # TODO: switch `vim` back to `vim-minimal` once https://issues.redhat.com/browse/RHEL-25748 is resolved | ||||||||||||||||||
| RUN microdnf -y upgrade && \ | ||||||||||||||||||
| microdnf -y install \ | ||||||||||||||||||
| hostname \ | ||||||||||||||||||
| iputils \ | ||||||||||||||||||
| less \ | ||||||||||||||||||
| ncurses \ | ||||||||||||||||||
| openssh-clients \ | ||||||||||||||||||
| rsync \ | ||||||||||||||||||
| tar \ | ||||||||||||||||||
| unzip \ | ||||||||||||||||||
| uuid \ | ||||||||||||||||||
| vim-minimal \ | ||||||||||||||||||
| /usr/bin/ps \ | ||||||||||||||||||
| /usr/bin/which \ | ||||||||||||||||||
| hostname \ | ||||||||||||||||||
| iputils \ | ||||||||||||||||||
| less \ | ||||||||||||||||||
| ncurses \ | ||||||||||||||||||
| openssh-clients \ | ||||||||||||||||||
| rsync \ | ||||||||||||||||||
| tar \ | ||||||||||||||||||
| unzip \ | ||||||||||||||||||
| uuid \ | ||||||||||||||||||
| vim-minimal \ | ||||||||||||||||||
| /usr/bin/ps \ | ||||||||||||||||||
| /usr/bin/which \ | ||||||||||||||||||
| && \ | ||||||||||||||||||
| rm -rf /var/cache/yum | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -35,22 +35,32 @@ RUN microdnf -y install \ | |||||||||||||||||
| automake \ | ||||||||||||||||||
| gcc \ | ||||||||||||||||||
| git \ | ||||||||||||||||||
| java-1.8.0-openjdk-devel \ | ||||||||||||||||||
| libtool \ | ||||||||||||||||||
| make | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| RUN if [ "$(uname -m)" = "x86_64" ]; then \ | ||||||||||||||||||
| curl -L https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u482-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u482b08.tar.gz --output /tmp/openjdk8.tar.gz; \ | ||||||||||||||||||
| elif [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then \ | ||||||||||||||||||
| curl -L https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u482-b08/OpenJDK8U-jdk_aarch64_linux_hotspot_8u482b08.tar.gz --output /tmp/openjdk8.tar.gz; \ | ||||||||||||||||||
| fi && \ | ||||||||||||||||||
| tar -xzf /tmp/openjdk8.tar.gz -C /opt && \ | ||||||||||||||||||
| rm -f /tmp/openjdk8.tar.gz | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Checkout and build JICMP | ||||||||||||||||||
| RUN git config --global advice.detachedHead false | ||||||||||||||||||
|
|
||||||||||||||||||
| RUN git clone --depth 1 --branch "${JICMP_VERSION}" "${JICMP_GIT_REPO_URL}" /usr/src/jicmp && \ | ||||||||||||||||||
| RUN export JAVA_HOME=/opt/jdk8u482-b08 && export PATH=/opt/jdk8u482-b08/bin:$PATH && \ | ||||||||||||||||||
| git clone --depth 1 --branch "${JICMP_VERSION}" "${JICMP_GIT_REPO_URL}" /usr/src/jicmp && \ | ||||||||||||||||||
| cd /usr/src/jicmp && \ | ||||||||||||||||||
| git submodule update --init --recursive --depth 1 && \ | ||||||||||||||||||
| autoreconf -fvi && \ | ||||||||||||||||||
| ./configure | ||||||||||||||||||
| RUN cd /usr/src/jicmp && make -j1 | ||||||||||||||||||
|
|
||||||||||||||||||
| # Checkout and build JICMP6 | ||||||||||||||||||
| RUN git clone --depth 1 --branch "${JICMP6_VERSION}" "${JICMP6_GIT_REPO_URL}" /usr/src/jicmp6 && \ | ||||||||||||||||||
| RUN export JAVA_HOME=/opt/jdk8u482-b08 && export PATH=/opt/jdk8u482-b08/bin:$PATH && \ | ||||||||||||||||||
| git clone --depth 1 --branch "${JICMP6_VERSION}" "${JICMP6_GIT_REPO_URL}" /usr/src/jicmp6 && \ | ||||||||||||||||||
| cd /usr/src/jicmp6 && \ | ||||||||||||||||||
| git submodule update --init --recursive --depth 1 && \ | ||||||||||||||||||
| autoreconf -fvi && \ | ||||||||||||||||||
|
|
@@ -66,25 +76,59 @@ RUN cd /usr/src/jattach && make | |||||||||||||||||
| ## | ||||||||||||||||||
| FROM core | ||||||||||||||||||
|
|
||||||||||||||||||
| RUN microdnf -y install \ | ||||||||||||||||||
| "java-${JAVA_MAJOR_VERSION}-openjdk-headless" \ | ||||||||||||||||||
| && \ | ||||||||||||||||||
| rm -rf /var/cache/yum | ||||||||||||||||||
| # if JAVA_MAJOR_VERSION is 11, use this: | ||||||||||||||||||
| # https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.30%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.30_7.tar.gz | ||||||||||||||||||
| RUN if [ "${JAVA_MAJOR_VERSION}" = "11" ]; then \ | ||||||||||||||||||
| if [ "$(uname -m)" = "x86_64" ]; then \ | ||||||||||||||||||
| curl -L "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.30%2B7/OpenJDK11U-jdk_x64_linux_hotspot_11.0.30_7.tar.gz" --output /tmp/openjdk.tar.gz; \ | ||||||||||||||||||
| elif [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then \ | ||||||||||||||||||
| curl -L "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.30%2B7/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.30_7.tar.gz" --output /tmp/openjdk.tar.gz; \ | ||||||||||||||||||
| fi && \ | ||||||||||||||||||
| tar -xzf /tmp/openjdk.tar.gz -C /opt && \ | ||||||||||||||||||
| rm -f /tmp/openjdk.tar.gz; \ | ||||||||||||||||||
| fi | ||||||||||||||||||
| # if JAVA_MAJOR_VERSION is 17, use this: | ||||||||||||||||||
| # https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.18%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.18_8.tar.gz | ||||||||||||||||||
| RUN if [ "${JAVA_MAJOR_VERSION}" = "17" ]; then \ | ||||||||||||||||||
| if [ "$(uname -m)" = "x86_64" ]; then \ | ||||||||||||||||||
| curl -L "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.18%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.18_8.tar.gz" --output /tmp/openjdk.tar.gz; \ | ||||||||||||||||||
| elif [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then \ | ||||||||||||||||||
| curl -L "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.18%2B8/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.18_8.tar.gz" --output /tmp/openjdk.tar.gz; \ | ||||||||||||||||||
| fi && \ | ||||||||||||||||||
| tar -xzf /tmp/openjdk.tar.gz -C /opt && \ | ||||||||||||||||||
| rm -f /tmp/openjdk.tar.gz; \ | ||||||||||||||||||
| fi | ||||||||||||||||||
| # else install using microdnf | ||||||||||||||||||
| RUN if [ "${JAVA_MAJOR_VERSION}" != "11" ] && [ "${JAVA_MAJOR_VERSION}" != "17" ]; then \ | ||||||||||||||||||
| echo "Installing OpenJDK ${JAVA_MAJOR_VERSION} via microdnf"; \ | ||||||||||||||||||
| microdnf -y install \ | ||||||||||||||||||
| "java-${JAVA_MAJOR_VERSION}-openjdk-headless" && \ | ||||||||||||||||||
| rm -rf /var/cache/yum; \ | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| # Set JAVA_HOME based on installed version - create a symlink for consistency | ||||||||||||||||||
| RUN if [ "${JAVA_MAJOR_VERSION}" = "11" ]; then \ | ||||||||||||||||||
| ln -sf /opt/jdk-11.0.30+7 /opt/java; \ | ||||||||||||||||||
| elif [ "${JAVA_MAJOR_VERSION}" = "17" ]; then \ | ||||||||||||||||||
| ln -sf /opt/jdk-17.0.18+8 /opt/java; \ | ||||||||||||||||||
|
Comment on lines
+110
to
+113
|
||||||||||||||||||
| RUN if [ "${JAVA_MAJOR_VERSION}" = "11" ]; then \ | |
| ln -sf /opt/jdk-11.0.30+7 /opt/java; \ | |
| elif [ "${JAVA_MAJOR_VERSION}" = "17" ]; then \ | |
| ln -sf /opt/jdk-17.0.18+8 /opt/java; \ | |
| RUN if [ "${JAVA_MAJOR_VERSION}" = "11" ] || [ "${JAVA_MAJOR_VERSION}" = "17" ]; then \ | |
| JDK_DIR=$(ls -d /opt/jdk-"${JAVA_MAJOR_VERSION}"* 2>/dev/null | head -n 1); \ | |
| if [ -z "${JDK_DIR}" ]; then echo "No JDK directory found for JAVA_MAJOR_VERSION=${JAVA_MAJOR_VERSION}" >&2; exit 1; fi; \ | |
| ln -sf "${JDK_DIR}" /opt/java; \ |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling GPG signature verification (--nodigest --nosignature --noverify) and package verification (gpgcheck=0) removes critical security checks. This exposes the build to potential package tampering. If this is temporary due to UBI 10 migration issues, consider documenting the reason and tracking removal of these flags once proper GPG keys are available.
| rpm -Uvh --nodigest --nosignature --noverify /tmp/repo.rpm && \ | |
| sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/opennms*.repo && \ | |
| rm -f /tmp/repo.rpm | |
| rpm -Uvh /tmp/repo.rpm && \ | |
| rm -f /tmp/repo.rpm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The architecture detection and URL construction logic is duplicated across JDK 8, 11, and 17 installations. Consider extracting this into a reusable function or parameterized block to reduce code duplication and improve maintainability.