-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
142 additions
and
38 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
File renamed without changes.
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,29 @@ | ||
ARG ARCH | ||
ARG OS_VERSION | ||
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.20 AS azure-vnet | ||
ARG VERSION | ||
WORKDIR /azure-container-networking | ||
COPY . . | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o azure-vnet.exe -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/network/plugin/main.go | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o azure-vnet-telemetry.exe -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/telemetry/service/telemetrymain.go | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o azure-vnet-ipam.exe -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 | ||
WORKDIR /dropgz | ||
COPY dropgz . | ||
COPY --from=azure-vnet /azure-container-networking/azure-vnet.exe pkg/embed/fs | ||
COPY --from=azure-vnet /azure-container-networking/azure-vnet-telemetry.exe pkg/embed/fs | ||
COPY --from=azure-vnet /azure-container-networking/azure-vnet-ipam.exe pkg/embed/fs | ||
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt | ||
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done | ||
|
||
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.20 AS dropgz | ||
ARG VERSION | ||
WORKDIR /dropgz | ||
COPY --from=compressor /dropgz . | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o bin/dropgz.exe -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 /dropgz/bin/dropgz.exe dropgz.exe | ||
ENTRYPOINT [ "dropgz.exe" ] |
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 ARCH | ||
ARG OS_VERSION | ||
FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core:2.0 AS tar | ||
RUN tdnf install -y tar | ||
RUN tdnf install -y unzip | ||
RUN tdnf upgrade -y && tdnf install -y ca-certificates | ||
|
||
FROM tar AS azure-vnet | ||
ARG AZCNI_VERSION=v1.5.4 | ||
ARG VERSION | ||
ARG OS | ||
ARG ARCH | ||
WORKDIR /azure-container-networking | ||
COPY . . | ||
RUN curl -LO --cacert /etc/ssl/certs/ca-certificates.crt https://github.com/Azure/azure-container-networking/releases/download/$AZCNI_VERSION/azure-vnet-cni-$OS-$ARCH-$AZCNI_VERSION.zip && unzip -o azure-vnet-cni-$OS-$ARCH-$AZCNI_VERSION.zip | ||
|
||
FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core:2.0 AS compressor | ||
ARG OS | ||
WORKDIR /dropgz | ||
COPY dropgz . | ||
COPY --from=azure-vnet /azure-container-networking/azure-vnet.exe pkg/embed/fs | ||
COPY --from=azure-vnet /azure-container-networking/azure-vnet-telemetry.exe pkg/embed/fs | ||
COPY --from=azure-vnet /azure-container-networking/azure-vnet-ipam.exe pkg/embed/fs | ||
RUN cd pkg/embed/fs/ && sha256sum * > sum.txt | ||
RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done | ||
|
||
FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.20 AS dropgz | ||
ARG VERSION | ||
WORKDIR /dropgz | ||
COPY --from=compressor /dropgz . | ||
RUN GOOS=windows CGO_ENABLED=0 go build -a -o bin/dropgz.exe -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 /dropgz/bin/dropgz.exe dropgz.exe | ||
ENTRYPOINT [ "dropgz.exe" ] |
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