You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While build windows images, we want to fully use the makefile target built on top of Linux to build binaries, so can we have a linux-based stage in the dockerfile to build the binary and then use windows-based stage to build the final windows image? something like this:
docker buildx build --platform windows/amd64 -f cloud-node-manager-windows.Dockerfile . and cloud-node-manager-windows.Dockerfile looks like
ARG OSVERSION=1809
ARG ARCH=amd64
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23
ARG ENABLE_GIT_COMMAND=true
ARG ARCH
WORKDIR /go/src/sigs.k8s.io/cloud-provider-azure
COPY . .
# Build the Go app
RUN make bin/azure-cloud-node-manager.exe ENABLE_GIT_COMMAND=${ENABLE_GIT_COMMAND} ARCH=${ARCH}
... ...
# windows-based stage
this dockerfile works fine in the following PR but I did not find any doc supporting this structure, can any expert shed some light on this? Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While build windows images, we want to fully use the makefile target built on top of Linux to build binaries, so can we have a linux-based stage in the dockerfile to build the binary and then use windows-based stage to build the final windows image? something like this:
docker buildx build --platform windows/amd64 -f cloud-node-manager-windows.Dockerfile .
and cloud-node-manager-windows.Dockerfile looks likethis dockerfile works fine in the following PR but I did not find any doc supporting this structure, can any expert shed some light on this? Thanks.
kubernetes-sigs/cloud-provider-azure#7836
Beta Was this translation helpful? Give feedback.
All reactions