Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Plus make it work with CentOS stream repo
  • Loading branch information
ksamoray committed Feb 7, 2022
1 parent 3ea9f5e commit 94bd51e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -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/
COPY --from=antrea-build /antrea/bin/* /usr/local/bin/
6 changes: 1 addition & 5 deletions build/images/base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions build/images/ovs/CentOS.repo
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions build/images/ovs/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

0 comments on commit 94bd51e

Please sign in to comment.