Skip to content

Commit

Permalink
create stateless cni image for version win 2025.
Browse files Browse the repository at this point in the history
  • Loading branch information
sivakami-projects committed Jul 24, 2024
1 parent 89483b3 commit 661e961
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pipelines/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ stages:
name: cni
os: windows
os_version: win2025
# stateless: true
stateless: true
cni_dropgz_linux_amd64:
arch: amd64
name: cni-dropgz
Expand Down
3 changes: 3 additions & 0 deletions cni/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ ARG ARCH
ARG DROPGZ_VERSION=v0.0.12
ARG OS_VERSION
ARG OS
ARG STATELESS=false

FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet
ARG OS
ARG VERSION
ARG STATELESS
WORKDIR /azure-container-networking
COPY . .
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/network/plugin/main.go
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-telemetry -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/telemetry/service/telemetrymain.go
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-ipam -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/ipam/plugin/main.go
RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/azure-vnet-stateless -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/network/stateless/main.go
RUN if [ "$STATELESS" = "true" ]; then mv /go/bin/azure-vnet-stateless /go/bin/azure-vnet; fi

FROM scratch as bins
COPY --from=azure-vnet /go/bin/* /
Expand Down

0 comments on commit 661e961

Please sign in to comment.