12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- FROM --platform=$BUILDPLATFORM golang:1.23.0 as builder
15
+ FROM --platform=$BUILDPLATFORM golang:1.23.0 AS builder
16
16
17
17
ARG STAGINGVERSION
18
18
ARG TARGETPLATFORM
@@ -23,24 +23,24 @@ RUN GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/') GCE_PD_CSI_STAGING_VERSION=$
23
23
24
24
# Start from Kubernetes Debian base.
25
25
26
- FROM gke.gcr.io/debian-base:bookworm-v1.0.4-gke.2 as debian
26
+ FROM gke.gcr.io/debian-base:bookworm-v1.0.4-gke.2 AS debian
27
27
28
28
# Install necessary dependencies
29
29
# google_nvme_id script depends on the following packages: nvme-cli, xxd, bash
30
30
RUN clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs nvme-cli xxd bash
31
31
32
32
# Since we're leveraging apt to pull in dependencies, we use `gcr.io/distroless/base` because it includes glibc.
33
- FROM gcr.io/distroless/base-debian12 as distroless-base
33
+ FROM gcr.io/distroless/base-debian12 AS distroless-base
34
34
35
35
# The distroless amd64 image has a target triplet of x86_64
36
36
FROM distroless-base AS distroless-amd64
37
- ENV LIB_DIR_PREFIX x86_64
37
+ ENV LIB_DIR_PREFIX= x86_64
38
38
39
39
# The distroless arm64 image has a target triplet of aarch64
40
40
FROM distroless-base AS distroless-arm64
41
- ENV LIB_DIR_PREFIX aarch64
41
+ ENV LIB_DIR_PREFIX= aarch64
42
42
43
- FROM distroless-$TARGETARCH as output-image
43
+ FROM distroless-$TARGETARCH
44
44
45
45
# Copy necessary dependencies into distroless base.
46
46
COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver /gce-pd-csi-driver
@@ -119,16 +119,4 @@ COPY --from=debian /usr/lib/${LIB_DIR_PREFIX}-linux-gnu/libblkid.so.1 \
119
119
# Copy NVME support required script and rules into distroless base.
120
120
COPY deploy/kubernetes/udev/google_nvme_id /lib/udev_containerized/google_nvme_id
121
121
122
- # Build stage used for validation of the output-image
123
- # See validate-container-linux-* targets in Makefile
124
- FROM output-image as validation-image
125
-
126
- COPY --from=debian /usr/bin/ldd /usr/bin/find /usr/bin/xargs /usr/bin/
127
- COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/hack/print-missing-deps.sh /print-missing-deps.sh
128
- SHELL ["/bin/bash" , "-c" ]
129
- RUN /print-missing-deps.sh
130
-
131
- # Final build stage, create the real Docker image with ENTRYPOINT
132
- FROM output-image
133
-
134
122
ENTRYPOINT ["/gce-pd-csi-driver" ]
0 commit comments