Update docker UBI image

Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
This commit is contained in:
faizanahmad055
2026-01-07 01:02:24 +01:00
parent 5ecd4057bb
commit 0924797e33

View File

@@ -20,8 +20,7 @@ RUN mkdir /image && \
COPY ubi-build-files-${TARGETARCH}.txt /tmp COPY ubi-build-files-${TARGETARCH}.txt /tmp
# Copy all the required files from the base UBI image into the image directory # Copy all the required files from the base UBI image into the image directory
# As the go binary is not statically compiled this includes everything needed for CGO to work, cacerts, tzdata and RH release files # As the go binary is not statically compiled this includes everything needed for CGO to work, cacerts, tzdata and RH release files
# Filter existing files before tarring to avoid "Cannot stat" errors on ARM64 # Filter existing files and exclude temporary entitlement files that may be removed during build
# Use -h flag to follow symlinks when creating the archive
RUN while IFS= read -r file; do \ RUN while IFS= read -r file; do \
[ -z "$file" ] && continue; \ [ -z "$file" ] && continue; \
if [ -e "$file" ] || [ -L "$file" ]; then \ if [ -e "$file" ] || [ -L "$file" ]; then \
@@ -29,8 +28,10 @@ RUN while IFS= read -r file; do \
fi; \ fi; \
done < /tmp/ubi-build-files-${TARGETARCH}.txt > /tmp/existing-files.txt && \ done < /tmp/ubi-build-files-${TARGETARCH}.txt > /tmp/existing-files.txt && \
if [ -s /tmp/existing-files.txt ]; then \ if [ -s /tmp/existing-files.txt ]; then \
tar -chf /tmp/files.tar -T /tmp/existing-files.txt && \ tar -chf /tmp/files.tar --exclude='etc/pki/entitlement-host*' -T /tmp/existing-files.txt 2>&1 | grep -vE "(File removed before we read it|Cannot stat)" || true; \
tar xf /tmp/files.tar -C /image/; \ if [ -f /tmp/files.tar ]; then \
tar xf /tmp/files.tar -C /image/ 2>/dev/null || true; \
fi; \
fi fi
# Generate a rpm database which contains all the packages that you said were needed in ubi-build-files-*.txt # Generate a rpm database which contains all the packages that you said were needed in ubi-build-files-*.txt