-
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.
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
93 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# {{.RENDER_MSG}} | ||
# SOURCE: {{.SRC}} | ||
ARG ARCH | ||
ARG DROPGZ_VERSION=v0.0.12 | ||
ARG OS_VERSION | ||
ARG OS | ||
|
||
# {{.GO_IMG}} | ||
FROM --platform=linux/${ARCH} {{.GO_PIN}} AS go | ||
|
||
# {{.MARINER_CORE_IMG}} | ||
FROM --platform=linux/${ARCH} {{.MARINER_CORE_PIN}} AS mariner-core | ||
|
||
FROM go AS azure-vnet | ||
ARG OS | ||
ARG VERSION | ||
ARG CNI_AI_PATH | ||
ARG CNI_AI_ID | ||
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" -X "$CNI_AI_PATH"="$CNI_AI_ID"" -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 | ||
|
||
FROM mariner-core AS compressor | ||
ARG 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-linux-multitenancy-transparent-vlan.conflist /payload/azure-multitenancy-transparent-vlan.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/cni/azure-$OS-multitenancy.conflist /payload/azure-multitenancy.conflist | ||
COPY --from=azure-vnet /azure-container-networking/telemetry/azure-vnet-telemetry.config /payload/azure-vnet-telemetry.config | ||
RUN cd /payload && sha256sum * > sum.txt | ||
RUN gzip --verbose --best --recursive /payload && for f in /payload/*.gz; do mv -- "$f" "${f%%.gz}"; done | ||
|
||
FROM go AS dropgz | ||
ARG DROPGZ_VERSION | ||
ARG OS | ||
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/ | ||
RUN GOOS=$OS 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 AS bins | ||
COPY --from=azure-vnet /go/bin/* / | ||
|
||
FROM scratch AS linux | ||
COPY --from=dropgz /go/bin/dropgz dropgz | ||
ENTRYPOINT [ "/dropgz" ] | ||
|
||
# {{.WIN_HPC_IMG}} | ||
FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} as hpc | ||
|
||
FROM hpc as windows | ||
COPY --from=dropgz /go/bin/dropgz 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