-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: build cni installer image with cni builds
Signed-off-by: Evan Baker <[email protected]>
- Loading branch information
Showing
8 changed files
with
126 additions
and
275 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
ARG ARCH | ||
ARG DROPGZ_VERSION=v0.0.12 | ||
ARG OS_VERSION | ||
ARG OS | ||
|
||
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet | ||
ARG VERSION | ||
WORKDIR /azure-container-networking | ||
COPY . . | ||
RUN GOOS=windows 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=windows 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=windows 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 | ||
|
||
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS compressor | ||
ARG OS=$OS | ||
WORKDIR /payload | ||
COPY --from=azure-vnet /go/bin/* /payload/azure-vnet | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS.conflist /payload/azure.conflist | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift.conflist /payload/azure-swift.conflist | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay.conflist /payload/azure-swift-overlay.conflist | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay-dualstack.conflist /payload/azure-swift-overlay-dualstack.conflist | ||
COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetry.config /payload/azure-vnet-telemetry.config | ||
RUN cd /azure-vnet && sha256sum * > sum.txt | ||
RUN gzip --verbose --best --recursive /azure-vnet && for f in /azure-vnet/*.gz; do mv -- "$f" "${f%%.gz}"; done | ||
|
||
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz | ||
ARG DROPGZ_VERISON=$DROPGZ_VERSION | ||
ARG VERSION | ||
RUN go mod download github.com/azure/azure-container-networking/dropgz@$DROPGZ_VERSION | ||
WORKDIR /go/pkg/mod/github.com/azure/azure-container-networking/dropgz\@$DROPGZ_VERSION | ||
COPY --from=compressor /payload/* /pkg/embed/fs/ | ||
COPY /go/src/azure-container-networking/cni/azure-$OS.conflist pkg/embed/fs/azure.conflist | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o /go/bin/dropgz -trimpath -ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" main.go | ||
|
||
FROM scratch | ||
COPY --from=dropgz /go/bin/dropgz dropgz | ||
ENTRYPOINT [ "dropgz" ] |
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,37 @@ | ||
ARG ARCH | ||
ARG DROPGZ_VERSION=v0.0.12 | ||
ARG OS | ||
ARG OS_VERSION | ||
|
||
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS azure-vnet | ||
ARG VERSION | ||
WORKDIR /azure-container-networking | ||
COPY . . | ||
RUN GOOS=windows 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=windows 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=windows 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 | ||
|
||
FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core:2.0 AS compressor | ||
ARG OS=$OS | ||
WORKDIR /payload | ||
COPY --from=azure-vnet /go/bin/* /payload/ | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS.conflist /payload/azure.conflist | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift.conflist /payload/azure-swift.conflist | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay.conflist /payload/azure-swift-overlay.conflist | ||
COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay-dualstack.conflist /payload/azure-swift-overlay-dualstack.conflist | ||
COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetry.config /payload/azure-vnet-telemetry.config | ||
RUN cd /azure-vnet && sha256sum * > sum.txt | ||
RUN gzip --verbose --best --recursive /azure-vnet && for f in /azure-vnet/*.gz; do mv -- "$f" "${f%%.gz}"; done | ||
|
||
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.21 AS dropgz | ||
ARG DROPGZ_VERISON=$DROPGZ_VERSION | ||
ARG VERSION | ||
RUN go mod download github.com/azure/azure-container-networking/dropgz@$DROPGZ_VERSION | ||
WORKDIR /go/pkg/mod/github.com/azure/azure-container-networking/dropgz\@$DROPGZ_VERSION | ||
COPY --from=compressor /payload/* /pkg/embed/fs/ | ||
COPY /go/src/azure-container-networking/cni/azure-$OS.conflist pkg/embed/fs/azure.conflist | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o /go/bin/dropgz -trimpath -ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" main.go | ||
|
||
FROM mcr.microsoft.com/windows/nanoserver:${OS_VERSION} | ||
COPY --from=dropgz /go/bin/dropgz dropgz | ||
ENTRYPOINT [ "dropgz" ] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.