From 94bd51ea0ebe5c90e8de84f8fd1423536429fb5e Mon Sep 17 00:00:00 2001 From: Kobi Samoray Date: Mon, 7 Feb 2022 16:36:31 +0200 Subject: [PATCH] Address review comments Plus make it work with CentOS stream repo --- build/images/Dockerfile.build.ubi | 2 +- build/images/base/build.sh | 6 +----- build/images/ovs/CentOS.repo | 18 +++++++++--------- build/images/ovs/Dockerfile.ubi | 18 +++++++++--------- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/build/images/Dockerfile.build.ubi b/build/images/Dockerfile.build.ubi index ef28a9c40ed..c769aa05145 100644 --- a/build/images/Dockerfile.build.ubi +++ b/build/images/Dockerfile.build.ubi @@ -20,4 +20,4 @@ LABEL description="The Docker image to deploy the Antrea CNI. " USER root COPY build/images/scripts/* /usr/local/bin/ -COPY --from=antrea-build /antrea/bin/* /usr/local/bin/ \ No newline at end of file +COPY --from=antrea-build /antrea/bin/* /usr/local/bin/ diff --git a/build/images/base/build.sh b/build/images/base/build.sh index cf61f5f366b..1348242b169 100755 --- a/build/images/base/build.sh +++ b/build/images/base/build.sh @@ -152,11 +152,7 @@ fi if $PUSH; then docker push antrea/cni-binaries:$CNI_BINARIES_VERSION - if [ "$DISTRO" == "ubuntu" ]; then - docker push antrea/base-ubuntu:$OVS_VERSION - elif [ "$DISTRO" == "ubi" ]; then - docker push antrea/base-ubi:$OVS_VERSION - fi + docker push antrea/base-$DISTRO:$OVS_VERSION fi popd > /dev/null diff --git a/build/images/ovs/CentOS.repo b/build/images/ovs/CentOS.repo index cb72e622cef..9eb710e79b5 100644 --- a/build/images/ovs/CentOS.repo +++ b/build/images/ovs/CentOS.repo @@ -1,23 +1,23 @@ [AppStream] -name=CentOS-$releasever - AppStream -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ +name=CentOS-8-stream - AppStream +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=AppStream&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/8-stream/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [BaseOS] -name=CentOS-$releasever - Base -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/ +name=CentOS-8-stream - Base +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=BaseOS&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/8-stream/BaseOS/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial [extras] -name=CentOS-$releasever - Extras -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra -#baseurl=http://mirror.centos.org/$contentdir/$releasever/extras/$basearch/os/ +name=CentOS-8-stream - Extras +mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=extras&infra=$infra +#baseurl=http://mirror.centos.org/$contentdir/8-stream/extras/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial diff --git a/build/images/ovs/Dockerfile.ubi b/build/images/ovs/Dockerfile.ubi index 23efef25b29..12eed251b4a 100644 --- a/build/images/ovs/Dockerfile.ubi +++ b/build/images/ovs/Dockerfile.ubi @@ -2,7 +2,8 @@ # https://docs.openvswitch.org/en/latest/intro/install/fedora FROM centos:centos7 as ovs-rpms -# Some patches may not apply cleanly if another version is provided. +# Some patches may not apply cleanly if a non-default version is provided. +# See build/images/deps/ovs-version for the default version. ARG OVS_VERSION # Install RPM tools and generic build dependencies. @@ -29,18 +30,17 @@ LABEL description="A Docker image based on UBI8 which includes Open vSwitch buil # Change Repository from UBI8’s to CentOS because UBI8's repository does not contain # enough packages required by OVS installation. -# Use the RHEL official repository is the best choice but it's not for free. +# Using the official RHEL repository would be the best choice but it's not publicly accessible. +# TODO: update the strongSwan logging config. COPY CentOS.repo /tmp/CentOS.repo +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 && \ - yum clean all -y && yum update -y && yum reinstall yum -y - -COPY charon-logging.conf /tmp -COPY --from=ovs-rpms /tmp/ovs-rpms/* /tmp/ovs-rpms/ -# TODO: update the strongSwan logging config. -RUN yum install /tmp/ovs-rpms/* -y && yum install epel-release -y && \ + 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 -rf /tmp/* + rm -rf /tmp/* && yum clean all