File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+
15
16
ARG BUILDPLATFORM
16
17
17
18
FROM --platform=$BUILDPLATFORM golang:1.17.2 as builder
@@ -28,10 +29,25 @@ FROM k8s.gcr.io/build-image/debian-base:buster-v1.9.0 as mad-hack
28
29
RUN clean-install udev
29
30
30
31
# Start from Kubernetes Debian base
31
- FROM k8s.gcr.io/build-image/debian-base:buster-v1.9.0
32
+ FROM k8s.gcr.io/build-image/debian-base:buster-v1.9.0 as debian
32
33
COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver /gce-pd-csi-driver
34
+
35
+
33
36
# Install necessary dependencies
34
37
RUN clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs
38
+
39
+ FROM gcr.io/distroless/base
40
+ COPY --from=builder /go/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver /gce-pd-csi-driver
35
41
COPY --from=mad-hack /lib/udev/scsi_id /lib/udev_containerized/scsi_id
42
+ # COPY --from=debian /lib/xfsprogs/ /lib/xfsprogs_containerized/
43
+ # COPY --from=debian /lib/util-linux/ /lib/util-linux_containerized/
44
+
45
+
36
46
37
47
ENTRYPOINT ["/gce-pd-csi-driver" ]
48
+
49
+ # Since you're leveraging apt to pull in dependencies, you'd want to use `gcr.io/distroless/base` as the ultimate base because it includes glibc
50
+
51
+
52
+ # COPY --from=builder /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/]
53
+ # RUN ["/busybox/sh", "-c", "clean-install util-linux e2fsprogs mount ca-certificates udev xfsprogs"]
You can’t perform that action at this time.
0 commit comments