forked from antrea-io/antrea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support antrea-agent UBI8 based image (antrea-io#3273)
Add the required code to build an Antrea image based on Red Hat UBI (Universal Base Image), which is in used by Red Hat platforms. Signed-off-by: Kobi Samoray <[email protected]>
- Loading branch information
Showing
20 changed files
with
337 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ARG GO_VERSION | ||
ARG OVS_VERSION | ||
FROM golang:${GO_VERSION} as antrea-build | ||
|
||
WORKDIR /antrea | ||
|
||
COPY go.mod /antrea/go.mod | ||
|
||
RUN go mod download | ||
|
||
COPY . /antrea | ||
|
||
RUN make antrea-agent antrea-controller antrea-cni antctl-linux | ||
RUN mv bin/antctl-linux bin/antctl | ||
|
||
FROM antrea/base-ubi:${OVS_VERSION} | ||
|
||
LABEL maintainer="Antrea <[email protected]>" | ||
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ RUN set -eux; \ | |
FROM antrea/openvswitch:${OVS_VERSION} | ||
|
||
LABEL maintainer="Antrea <[email protected]>" | ||
LABEL description="Takes care of building the Antrea binaries as part of building the image." | ||
LABEL description="An Ubuntu based Docker base image for Antrea." | ||
|
||
USER root | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ARG OVS_VERSION | ||
FROM ubuntu:20.04 as cni-binaries | ||
|
||
ARG CNI_BINARIES_VERSION | ||
ARG WHEREABOUTS_VERSION=v0.4.2 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends wget ca-certificates | ||
|
||
# Leading dot is required for the tar command below | ||
ENV CNI_PLUGINS="./host-local ./loopback ./portmap ./bandwidth" | ||
|
||
# Download containernetworking plugin binaries for the correct architecture | ||
RUN set -eux; \ | ||
dpkgArch="$(dpkg --print-architecture)"; \ | ||
case "${dpkgArch##*-}" in \ | ||
amd64) pluginsArch='amd64' ;; \ | ||
armhf) pluginsArch='arm' ;; \ | ||
arm64) pluginsArch='arm64' ;; \ | ||
*) pluginsArch=''; echo >&2; echo >&2 "unsupported architecture '$dpkgArch'"; echo >&2 ; exit 1 ;; \ | ||
esac; \ | ||
mkdir -p /opt/cni/bin; \ | ||
wget -q -O - https://github.com/containernetworking/plugins/releases/download/$CNI_BINARIES_VERSION/cni-plugins-linux-${pluginsArch}-$CNI_BINARIES_VERSION.tgz | tar xz -C /opt/cni/bin $CNI_PLUGINS; \ | ||
wget -q -O - https://downloads.antrea.io/whereabouts/$WHEREABOUTS_VERSION/whereabouts-linux-${pluginsArch}.tgz | tar xz -C /opt/cni/bin/ whereabouts-linux-${pluginsArch}/whereabouts --strip-components=1 --no-same-owner | ||
|
||
FROM antrea/openvswitch-ubi:${OVS_VERSION} | ||
|
||
LABEL maintainer="Antrea <[email protected]>" | ||
LABEL description="An UBI8 based Docker base image for Antrea." | ||
|
||
USER root | ||
|
||
RUN yum install ipset jq -y && yum clean all | ||
|
||
COPY --from=cni-binaries /opt/cni/bin /opt/cni/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[AppStream] | ||
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-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-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 |
Oops, something went wrong.