Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ FROM registry.redhat.io/rhel10/rhel-bootc:10.0
ARG USHIFT_RPM_REPO_NAME=microshift-local
ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME

# Configure the RPM repositories (without EUS enabled)
COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh
RUN /tmp/rpm-repo-config.sh && rm -f /tmp/rpm-repo-config.sh

# Copy the MicroShift repository contents
COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH

# Copy repository configuration
COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo /etc/yum.repos.d/

# Print repository configuration contents.
# Install test agent and cleanup.
RUN dnf repoinfo --enabled && \
dnf install -y microshift-test-agent && \
# Install the test agent and cleanup
RUN dnf install -y microshift-test-agent && \
systemctl enable microshift-test-agent && \
rm -vf /etc/yum.repos.d/microshift-*.repo && \
rm -rvf $USHIFT_RPM_REPO_PATH && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ FROM registry.redhat.io/rhel9-eus/rhel-9.6-bootc:9.6
ARG USHIFT_RPM_REPO_NAME=microshift-local
ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME

# Configure the RPM repositories (with EUS enabled)
COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh
RUN /tmp/rpm-repo-config.sh --enable-eus && rm -f /tmp/rpm-repo-config.sh

# Copy the MicroShift repository contents
COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH

# Copy repository configuration
COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo /etc/yum.repos.d/

# Print repository configuration contents.
# Install test agent and cleanup.
RUN dnf repoinfo --enabled && \
dnf install -y microshift-test-agent && \
# Install the test agent and cleanup
RUN dnf install -y microshift-test-agent && \
systemctl enable microshift-test-agent && \
rm -vf /etc/yum.repos.d/microshift-*.repo && \
rm -rvf $USHIFT_RPM_REPO_PATH && \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -euo pipefail
set -x

function enable_eus_repositories() {
local -r vmajor="$(awk -F. '{print $1}' <<< "${VERSION_ID}")"
local -r vminor="$(awk -F. '{print $2}' <<< "${VERSION_ID}")"

dnf config-manager --set-disabled '*'
dnf config-manager --set-enabled \
"rhel-${vmajor}-for-$(uname -m)-baseos-eus-rpms" \
"rhel-${vmajor}-for-$(uname -m)-appstream-eus-rpms"
}

# Lock the OS release version to prevent the installation of packages belonging
# to a newer OS release
source /etc/os-release
echo "${VERSION_ID}" > /etc/dnf/vars/releasever

# Process the command line arguments
while [ $# -gt 0 ] ; do
case "$1" in
--enable-eus)
enable_eus_repositories
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done

# Print the enabled repositories
dnf repoinfo --enabled
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,9 @@ function get_kernel_ver() {
# Set the current kernel version and architecture variables.
get_kernel_ver

# Lock the OS release version to prevent the installation of a newer kernel package
# belonging to a newer OS release. This file should not be removed to allow subsequent
# dnf command execution.
source /etc/os-release
echo "${VERSION_ID}" > /etc/dnf/vars/releasever

if [[ "${ID}" == "rhel" ]] ; then
# On RHEL, enable RHEL EUS repositories to allow the installation of the
# kernel-devel package for the current kernel version.
VERSION_ID_MAJOR="$(awk -F. '{print $1}' <<< "${VERSION_ID}")"
VERSION_ID_MINOR="$(awk -F. '{print $2}' <<< "${VERSION_ID}")"
if (( "${VERSION_ID_MINOR}" % 2 == 0 )) ; then
dnf config-manager --set-enabled \
"rhel-${VERSION_ID_MAJOR}-for-$(uname -m)-baseos-eus-rpms" \
"rhel-${VERSION_ID_MAJOR}-for-$(uname -m)-appstream-eus-rpms"
fi
# On RHEL, always install the kernel-devel package for the current kernel version.
dnf install -y "kernel-devel-${KERNEL_VER}"
else
# On CentOS, attempt to install the kernel-devel package for the current kernel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ FROM quay.io/centos-bootc/centos-bootc:stream10
ARG USHIFT_RPM_REPO_NAME=microshift-local
ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME

# Configure the RPM repositories (no EUS on CentOS)
COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh
RUN /tmp/rpm-repo-config.sh && rm -f /tmp/rpm-repo-config.sh

# Copy the MicroShift repository contents
COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH

# Copy repository configuration
COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo /etc/yum.repos.d/

# Print repository configuration contents.
# Install test agent and cleanup.
RUN dnf repoinfo --enabled && \
dnf install -y microshift-test-agent && \
# Install the test agent and cleanup
RUN dnf install -y microshift-test-agent && \
systemctl enable microshift-test-agent && \
rm -vf /etc/yum.repos.d/microshift-*.repo && \
rm -rvf $USHIFT_RPM_REPO_PATH && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ FROM quay.io/centos-bootc/centos-bootc:stream9
ARG USHIFT_RPM_REPO_NAME=microshift-local
ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME

# Configure the RPM repositories (no EUS on CentOS)
COPY --chmod=755 ./bootc-images/rpm-repo-config.sh /tmp/rpm-repo-config.sh
RUN /tmp/rpm-repo-config.sh && rm -f /tmp/rpm-repo-config.sh

# Copy the MicroShift repository contents
COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH

# Copy repository configuration
COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo /etc/yum.repos.d/

# Print repository configuration contents.
# Install test agent and cleanup.
RUN dnf repoinfo --enabled && \
dnf install -y microshift-test-agent && \
# Install the test agent and cleanup
RUN dnf install -y microshift-test-agent && \
systemctl enable microshift-test-agent && \
rm -vf /etc/yum.repos.d/microshift-*.repo && \
rm -rvf $USHIFT_RPM_REPO_PATH && \
Expand Down