Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoBgp client cli capability #6539

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions build/images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ RUN set -eux; \
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

FROM ubuntu:22.04 AS gobgp-binary

ARG GOBGP_VERSION

RUN apt-get update && \
apt-get install -y --no-install-recommends wget ca-certificates

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/bgp; \
wget -q -O - https://github.com/osrg/gobgp/releases/download/v$GOBGP_VERSION/gobgp_${GOBGP_VERSION}_linux_${pluginsArch}.tar.gz | tar xz -C /opt/bgp

FROM antrea/openvswitch:${BUILD_TAG}

ARG SURICATA_VERSION
Expand All @@ -57,3 +75,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends ipset jq inotif
/iptables-wrapper-installer.sh

COPY --from=cni-binaries /opt/cni/bin /opt/cni/bin
COPY --from=gobgp-binary /opt/bgp/gobgp /usr/local/bin
19 changes: 19 additions & 0 deletions build/images/base/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ RUN set -eux; \
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

FROM ubuntu:22.04 AS gobgp-binary

ARG GOBGP_VERSION

RUN apt-get update && \
apt-get install -y --no-install-recommends wget ca-certificates

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/bgp; \
wget -q -O - https://github.com/osrg/gobgp/releases/download/v$GOBGP_VERSION/gobgp_${GOBGP_VERSION}_linux_${pluginsArch}.tar.gz | tar xz -C /opt/bgp

FROM antrea/openvswitch-ubi:${BUILD_TAG}

ARG SURICATA_VERSION
Expand All @@ -50,3 +68,4 @@ RUN yum install ipset jq yum-plugin-copr -y && \
yum remove yum-plugin-copr -y && yum clean all

COPY --from=cni-binaries /opt/cni/bin /opt/cni/bin
COPY --from=gobgp-binary /opt/bgp/gobgp /usr/local/bin
3 changes: 2 additions & 1 deletion build/images/base/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pushd $THIS_DIR > /dev/null

CNI_BINARIES_VERSION=$(head -n 1 ../deps/cni-binaries-version)
SURICATA_VERSION=$(head -n 1 ../deps/suricata-version)
GOBGP_VERSION=$(grep "github.com/osrg/gobgp" ../../../go.mod | head -n1 | cut -d " " -f2 | cut -c 2-)

BUILD_CACHE_TAG=$(../build-tag.sh)

Expand Down Expand Up @@ -152,7 +153,7 @@ fi
function docker_build_and_push() {
local image="$1"
local dockerfile="$2"
local build_args="--build-arg CNI_BINARIES_VERSION=$CNI_BINARIES_VERSION --build-arg SURICATA_VERSION=$SURICATA_VERSION --build-arg BUILD_TAG=$BUILD_TAG"
local build_args="--build-arg CNI_BINARIES_VERSION=$CNI_BINARIES_VERSION --build-arg SURICATA_VERSION=$SURICATA_VERSION --build-arg GOBGP_VERSION=$GOBGP_VERSION --build-arg BUILD_TAG=$BUILD_TAG"
local cache_args=""
if $PUSH; then
cache_args="$cache_args --cache-to type=registry,ref=$image-cache:$BUILD_CACHE_TAG,mode=max"
Expand Down
Loading