Skip to content

Commit

Permalink
Fix UBI image build error (#4454)
Browse files Browse the repository at this point in the history
subscription-manager is disabled when running inside a container.
Modify rhsm.conf to achieve the same result.

Signed-off-by: Xu Liu <[email protected]>
  • Loading branch information
xliuxu authored Dec 7, 2022
1 parent 655129d commit c891945
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/images/ovs/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ COPY charon-logging.conf /tmp
COPY --from=ovs-rpms /tmp/ovs-rpms/* /tmp/ovs-rpms/
RUN rm -f /etc/yum.repos.d/* && mv /tmp/CentOS.repo /etc/yum.repos.d/CentOS.repo && \
curl https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official -o /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial && \
subscription-manager config --rhsm.manage_repos=0 && \
# Disable the default redhat.repo. This substitutes `subscription-manager config --rhsm.manage_repos=0`
# as subscription-manager is not supported running in containers.
sed -i.bak "s/^manage_repos = .$/manage_repos = 0/g" /etc/rhsm/rhsm.conf && \
yum clean all -y && yum reinstall yum -y && \
yum install /tmp/ovs-rpms/* -y && yum install epel-release -y && \
yum install iptables logrotate strongswan -y && \
mv /etc/logrotate.d/openvswitch /etc/logrotate.d/openvswitch-switch && \
sed -i "/rotate /a\ #size 100M" /etc/logrotate.d/openvswitch-switch && \
rm /etc/rhsm/rhsm.conf.bak && \
rm -rf /tmp/* && yum clean all

0 comments on commit c891945

Please sign in to comment.