From f114ec302315726414ae9adf6c83d2c0bf5a7731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Mon, 2 Dec 2024 10:58:30 +0100 Subject: [PATCH 1/2] Update JDK patch versions to latest from sdkman (#193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Pupier Signed-off-by: Ivan Suftin --- README.md | 8 ++++---- universal/ubi8/Dockerfile | 22 +++++++++++----------- universal/ubi9/Dockerfile | 22 +++++++++++----------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index b2dafa3a..4133d577 100644 --- a/README.md +++ b/README.md @@ -100,10 +100,10 @@ docker run -ti --rm \ |---------------------|-------------------------------------| |--------JAVA---------|-------------------------------------| | `sdk` |`` | -| `java` |`<8.0.402-tem via sdkman>` | -| `java` |`<11.0.22-tem via sdkman>` | -| `java` |`<17.0.10-tem via sdkman>/default` | -| `java` |`<21.0.2-tem via sdkman>` | +| `java` |`<8.0.432-tem via sdkman>` | +| `java` |`<11.0.25-tem via sdkman>` | +| `java` |`<17.0.13-tem via sdkman>/default` | +| `java` |`<21.0.5-tem via sdkman>` | | `maven` |`` | | `gradle` |`` | | `mandrel` |`<22.1.2.r21-mandrel via sdkman>` | diff --git a/universal/ubi8/Dockerfile b/universal/ubi8/Dockerfile index 27f041bc..de25df68 100644 --- a/universal/ubi8/Dockerfile +++ b/universal/ubi8/Dockerfile @@ -33,12 +33,12 @@ RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ && bash -c ". /home/tooling/.sdkman/bin/sdkman-init.sh \ && sed -i "s/sdkman_auto_answer=false/sdkman_auto_answer=true/g" /home/tooling/.sdkman/etc/config \ && sed -i "s/sdkman_auto_env=false/sdkman_auto_env=true/g" /home/tooling/.sdkman/etc/config \ - && sdk install java 8.0.402-tem \ - && sdk install java 11.0.22-tem \ - && sdk install java 17.0.10-tem \ - && sdk install java 21.0.2-tem \ - && sdk install java 23.1.2.r21-mandrel \ - && sdk default java 17.0.10-tem \ + && sdk install java 8.0.432-tem \ + && sdk install java 11.0.25-tem \ + && sdk install java 17.0.13-tem \ + && sdk install java 21.0.5-tem \ + && sdk install java 23.1.5.r21-mandrel \ + && sdk default java 17.0.13-tem \ && sdk install gradle \ && sdk install maven \ && sdk install jbang \ @@ -47,10 +47,10 @@ RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ && chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling # sdk home java -ENV JAVA_HOME_8=/home/tooling/.sdkman/candidates/java/8.0.402-tem -ENV JAVA_HOME_11=/home/tooling/.sdkman/candidates/java/11.0.22-tem -ENV JAVA_HOME_17=/home/tooling/.sdkman/candidates/java/17.0.10-tem -ENV JAVA_HOME_21=/home/tooling/.sdkman/candidates/java/21.0.2-tem +ENV JAVA_HOME_8=/home/tooling/.sdkman/candidates/java/8.0.432-tem +ENV JAVA_HOME_11=/home/tooling/.sdkman/candidates/java/11.0.25-tem +ENV JAVA_HOME_17=/home/tooling/.sdkman/candidates/java/17.0.13-tem +ENV JAVA_HOME_21=/home/tooling/.sdkman/candidates/java/21.0.5-tem # Java-related environment variables are described and set by ${PROFILE_EXT}, which will be loaded by ~/.bashrc # To make Java working for dash and other shells, it needs to initialize them in the Dockerfile. @@ -64,7 +64,7 @@ ENV GRADLE_HOME="/home/tooling/.sdkman/candidates/gradle/current" ENV JAVA_HOME="/home/tooling/.sdkman/candidates/java/current" ENV MAVEN_HOME="/home/tooling/.sdkman/candidates/maven/current" -ENV GRAALVM_HOME=/home/tooling/.sdkman/candidates/java/23.1.2.r21-mandrel +ENV GRAALVM_HOME=/home/tooling/.sdkman/candidates/java/23.1.5.r21-mandrel ENV PATH="/home/tooling/.krew/bin:$PATH" ENV PATH="/home/tooling/.sdkman/candidates/maven/current/bin:$PATH" diff --git a/universal/ubi9/Dockerfile b/universal/ubi9/Dockerfile index c205ddaa..8f6fa3b0 100644 --- a/universal/ubi9/Dockerfile +++ b/universal/ubi9/Dockerfile @@ -33,12 +33,12 @@ RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ && bash -c ". /home/tooling/.sdkman/bin/sdkman-init.sh \ && sed -i "s/sdkman_auto_answer=false/sdkman_auto_answer=true/g" /home/tooling/.sdkman/etc/config \ && sed -i "s/sdkman_auto_env=false/sdkman_auto_env=true/g" /home/tooling/.sdkman/etc/config \ - && sdk install java 8.0.402-tem \ - && sdk install java 11.0.22-tem \ - && sdk install java 17.0.10-tem \ - && sdk install java 21.0.2-tem \ - && sdk install java 23.1.2.r21-mandrel \ - && sdk default java 17.0.10-tem \ + && sdk install java 8.0.432-tem \ + && sdk install java 11.0.25-tem \ + && sdk install java 17.0.13-tem \ + && sdk install java 21.0.5-tem \ + && sdk install java 23.1.5.r21-mandrel \ + && sdk default java 17.0.13-tem \ && sdk install gradle \ && sdk install maven \ && sdk install jbang \ @@ -47,10 +47,10 @@ RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ && chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling # sdk home java -ENV JAVA_HOME_8=/home/tooling/.sdkman/candidates/java/8.0.402-tem -ENV JAVA_HOME_11=/home/tooling/.sdkman/candidates/java/11.0.22-tem -ENV JAVA_HOME_17=/home/tooling/.sdkman/candidates/java/17.0.10-tem -ENV JAVA_HOME_21=/home/tooling/.sdkman/candidates/java/21.0.2-tem +ENV JAVA_HOME_8=/home/tooling/.sdkman/candidates/java/8.0.432-tem +ENV JAVA_HOME_11=/home/tooling/.sdkman/candidates/java/11.0.25-tem +ENV JAVA_HOME_17=/home/tooling/.sdkman/candidates/java/17.0.13-tem +ENV JAVA_HOME_21=/home/tooling/.sdkman/candidates/java/21.0.5-tem # Java-related environment variables are described and set by ${PROFILE_EXT}, which will be loaded by ~/.bashrc # To make Java working for dash and other shells, it needs to initialize them in the Dockerfile. @@ -64,7 +64,7 @@ ENV GRADLE_HOME="/home/tooling/.sdkman/candidates/gradle/current" ENV JAVA_HOME="/home/tooling/.sdkman/candidates/java/current" ENV MAVEN_HOME="/home/tooling/.sdkman/candidates/maven/current" -ENV GRAALVM_HOME=/home/tooling/.sdkman/candidates/java/23.1.2.r21-mandrel +ENV GRAALVM_HOME=/home/tooling/.sdkman/candidates/java/23.1.5.r21-mandrel ENV PATH="/home/tooling/.krew/bin:$PATH" ENV PATH="/home/tooling/.sdkman/candidates/maven/current/bin:$PATH" From 37167fde168d0aeb90c051b34575460d407b2fb7 Mon Sep 17 00:00:00 2001 From: Ivan Suftin Date: Wed, 4 Dec 2024 13:38:55 -0600 Subject: [PATCH 2/2] fix: Update .stow-local-ignore with files in /home/user that would break running stow Signed-off-by: Ivan Suftin --- universal/ubi8/entrypoint.sh | 26 ++++++++++++++++++++++++++ universal/ubi9/entrypoint.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/universal/ubi8/entrypoint.sh b/universal/ubi8/entrypoint.sh index aeb28436..1a22938e 100755 --- a/universal/ubi8/entrypoint.sh +++ b/universal/ubi8/entrypoint.sh @@ -12,6 +12,32 @@ mountpoint -q /home/user/; HOME_USER_MOUNTED=$? STOW_COMPLETE=/home/user/.stow_completed if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then + # There may be regular, non-symlink files in /home/user that match the + # pathing of files in /home/tooling. Stow will error out when it tries to + # stow on top of that. Instead, we can append to the current + # /home/tooling/.stow-local-ignore file to ignore pre-existing, + # non-symlinked files in /home/user that match those in /home/tooling before + # we run stow. + # + # Create two text files containing a sorted path-based list of files in + # /home/tooling and /home/user. Cut off "/home/user" and "/home/tooling" and + # only get the sub-paths so we can do a proper comparison + # + # In the case of /home/user, we want regular file types and not symbolic + # links. + find /home/user -type f -xtype f -print | sort | sed 's|/home/user||g' > /tmp/user.txt + find /home/tooling -print | sort | sed 's|/home/tooling||g' > /tmp/tooling.txt + # We compare the two files, trying to find files that exist in /home/user + # and /home/tooling. Being that the files that get flagged here are not + # already synlinks, we will want to ignore them. + IGNORE_FILES="$(comm -12 /tmp/user.txt /tmp/tooling.txt)" + # We no longer require the file lists, so remove them + rm /tmp/user.txt /tmp/tooling.txt + # For each file we need to ignore, append them to + # /home/tooling/.stow-local-ignore. + for f in $IGNORE_FILES; do echo "${f}" >> /home/tooling/.stow-local-ignore;done + # We are now ready to run stow + # # Create symbolic links from /home/tooling/ -> /home/user/ stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1 # Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it diff --git a/universal/ubi9/entrypoint.sh b/universal/ubi9/entrypoint.sh index aeb28436..1a22938e 100755 --- a/universal/ubi9/entrypoint.sh +++ b/universal/ubi9/entrypoint.sh @@ -12,6 +12,32 @@ mountpoint -q /home/user/; HOME_USER_MOUNTED=$? STOW_COMPLETE=/home/user/.stow_completed if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then + # There may be regular, non-symlink files in /home/user that match the + # pathing of files in /home/tooling. Stow will error out when it tries to + # stow on top of that. Instead, we can append to the current + # /home/tooling/.stow-local-ignore file to ignore pre-existing, + # non-symlinked files in /home/user that match those in /home/tooling before + # we run stow. + # + # Create two text files containing a sorted path-based list of files in + # /home/tooling and /home/user. Cut off "/home/user" and "/home/tooling" and + # only get the sub-paths so we can do a proper comparison + # + # In the case of /home/user, we want regular file types and not symbolic + # links. + find /home/user -type f -xtype f -print | sort | sed 's|/home/user||g' > /tmp/user.txt + find /home/tooling -print | sort | sed 's|/home/tooling||g' > /tmp/tooling.txt + # We compare the two files, trying to find files that exist in /home/user + # and /home/tooling. Being that the files that get flagged here are not + # already synlinks, we will want to ignore them. + IGNORE_FILES="$(comm -12 /tmp/user.txt /tmp/tooling.txt)" + # We no longer require the file lists, so remove them + rm /tmp/user.txt /tmp/tooling.txt + # For each file we need to ignore, append them to + # /home/tooling/.stow-local-ignore. + for f in $IGNORE_FILES; do echo "${f}" >> /home/tooling/.stow-local-ignore;done + # We are now ready to run stow + # # Create symbolic links from /home/tooling/ -> /home/user/ stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1 # Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it