@@ -38,15 +38,15 @@ ARG DEBIAN_IMAGE=registry.k8s.io/build-image/debian-base:bookworm-v1.0.4
38
38
# Build an image containing a common ca-certificates used by all target images
39
39
# regardless of how they are built. We arbitrarily take ca-certificates from
40
40
# the amd64 Alpine image.
41
- FROM --platform=linux/amd64 ${ALPINE_IMAGE} as certs
41
+ FROM --platform=${BUILDPLATFORM} ${ALPINE_IMAGE} AS certs
42
42
RUN apk add --no-cache ca-certificates
43
43
44
44
45
45
# Build all command targets. We build all command targets in a single build
46
46
# stage for efficiency. Target images copy their binary from this image.
47
47
# We use go's native cross compilation for multi-arch in this stage, so the
48
48
# builder itself is always amd64
49
- FROM --platform=linux/amd64 ${GOLANG_IMAGE} as builder
49
+ FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} AS builder
50
50
51
51
ARG GOPROXY=https://goproxy.io,direct
52
52
ARG TARGETOS
@@ -67,7 +67,7 @@ RUN make build GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=${GOPROXY} VERSION=
67
67
# #
68
68
# # openstack-cloud-controller-manager
69
69
# #
70
- FROM --platform=${TARGETPLATFORM} ${ DISTROLESS_IMAGE} as openstack-cloud-controller-manager
70
+ FROM ${ DISTROLESS_IMAGE} AS openstack-cloud-controller-manager
71
71
72
72
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
73
73
COPY --from=builder /build/openstack-cloud-controller-manager /bin/openstack-cloud-controller-manager
@@ -85,7 +85,7 @@ CMD [ "/bin/openstack-cloud-controller-manager" ]
85
85
# #
86
86
# # barbican-kms-plugin
87
87
# #
88
- FROM --platform=${TARGETPLATFORM} ${ ALPINE_IMAGE} as barbican-kms-plugin
88
+ FROM ${ ALPINE_IMAGE} AS barbican-kms-plugin
89
89
# barbican-kms-plugin uses ALPINE instead of distroless because its entrypoint
90
90
# uses a shell for environment substitution. If there are no other uses this
91
91
# could be replaced by callers passing arguments explicitly.
@@ -109,15 +109,15 @@ CMD ["sh", "-c", "/bin/barbican-kms-plugin --socketpath ${socketpath} --cloud-co
109
109
110
110
# step 1: copy all necessary files from Debian distro to /dest folder
111
111
# all magic happens in tools/csi-deps.sh
112
- FROM --platform=${TARGETPLATFORM} ${ DEBIAN_IMAGE} as cinder-csi-plugin-utils
112
+ FROM ${ DEBIAN_IMAGE} AS cinder-csi-plugin-utils
113
113
114
114
RUN clean-install bash rsync mount udev btrfs-progs e2fsprogs xfsprogs util-linux
115
115
COPY tools/csi-deps.sh /tools/csi-deps.sh
116
116
RUN /tools/csi-deps.sh
117
117
118
118
# step 2: check if all necessary files are copied and work properly
119
119
# the build have to finish without errors, but the result image will not be used
120
- FROM --platform=${TARGETPLATFORM} ${ DISTROLESS_IMAGE} as cinder-csi-plugin-utils-check
120
+ FROM ${ DISTROLESS_IMAGE} AS cinder-csi-plugin-utils-check
121
121
122
122
COPY --from=cinder-csi-plugin-utils /dest /
123
123
COPY --from=cinder-csi-plugin-utils /bin/sh /bin/sh
@@ -127,7 +127,7 @@ SHELL ["/bin/sh"]
127
127
RUN /tools/csi-deps-check.sh
128
128
129
129
# step 3: build tiny cinder-csi-plugin image with only necessary files
130
- FROM --platform=${TARGETPLATFORM} ${ DISTROLESS_IMAGE} as cinder-csi-plugin
130
+ FROM ${ DISTROLESS_IMAGE} AS cinder-csi-plugin
131
131
132
132
# Copying csi-deps-check.sh simply ensures that the resulting image has a dependency
133
133
# on cinder-csi-plugin-utils-check and therefore that the check has passed
@@ -149,7 +149,7 @@ CMD ["/bin/cinder-csi-plugin"]
149
149
# #
150
150
# # k8s-keystone-auth
151
151
# #
152
- FROM --platform=${TARGETPLATFORM} ${ DISTROLESS_IMAGE} as k8s-keystone-auth
152
+ FROM ${ DISTROLESS_IMAGE} AS k8s-keystone-auth
153
153
154
154
COPY --from=builder /build/k8s-keystone-auth /bin/k8s-keystone-auth
155
155
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
@@ -169,7 +169,7 @@ CMD ["/bin/k8s-keystone-auth"]
169
169
# #
170
170
# # magnum-auto-healer
171
171
# #
172
- FROM --platform=${TARGETPLATFORM} ${ DISTROLESS_IMAGE} as magnum-auto-healer
172
+ FROM ${ DISTROLESS_IMAGE} AS magnum-auto-healer
173
173
174
174
COPY --from=builder /build/magnum-auto-healer /bin/magnum-auto-healer
175
175
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
@@ -187,7 +187,7 @@ CMD ["/bin/magnum-auto-healer"]
187
187
# #
188
188
# # manila-csi-plugin
189
189
# #
190
- FROM --platform=${TARGETPLATFORM} ${ ALPINE_IMAGE} as manila-csi-plugin
190
+ FROM ${ ALPINE_IMAGE} AS manila-csi-plugin
191
191
# manila-csi-plugin uses ALPINE because it pulls in jq and curl
192
192
193
193
RUN apk add --no-cache jq curl
@@ -208,7 +208,7 @@ ENTRYPOINT ["/bin/manila-csi-plugin"]
208
208
# #
209
209
# # octavia-ingress-controller
210
210
# #
211
- FROM --platform=${TARGETPLATFORM} ${ DISTROLESS_IMAGE} as octavia-ingress-controller
211
+ FROM ${ DISTROLESS_IMAGE} AS octavia-ingress-controller
212
212
213
213
COPY --from=builder /build/octavia-ingress-controller /bin/octavia-ingress-controller
214
214
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
0 commit comments