-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-csi-node
More file actions
81 lines (70 loc) · 3.58 KB
/
Copy pathDockerfile-csi-node
File metadata and controls
81 lines (70 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright IBM Corporation 2026.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Build stage
FROM golang:1.25 AS builder
WORKDIR /go/src/github.com/ibm/ibm-block-csi-driver
ENV GO111MODULE=on
# Populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN make ibm-block-csi-driver
# Final stage
FROM registry.access.redhat.com/ubi9-minimal:9.7-1773939694
# Install required sg3_utils (with libs) and try multipath (optional) from any available repo.
RUN microdnf install -y sg3_utils sg3_utils-libs || exit 1 \
&& (microdnf install -y device-mapper-multipath || microdnf install -y multipath-tools || echo "multipath not available; falling back") \
&& microdnf clean all
ARG VERSION=1.13.2
ARG BUILD_NUMBER=0
LABEL name="IBM block storage CSI driver node" \
vendor="IBM" \
maintainer="IBM" \
version=$VERSION \
release=$BUILD_NUMBER \
summary="The node component of the IBM block storage CSI driver" \
description="The IBM block storage CSI driver enables container orchestrators, such as Kubernetes and OpenShift, to manage the life-cycle of persistent storage." \
io.k8s.display-name="IBM block storage CSI driver node" \
io.k8s.description="The IBM block storage CSI driver enables container orchestrators, such as Kubernetes and OpenShift, to manage the life-cycle of persistent storage." \
io.openshift.tags=ibm,csi,ibm-block-csi-driver,ibm-block-csi-node
WORKDIR /root
COPY --from=builder /go/src/github.com/ibm/ibm-block-csi-driver/common/config.yaml .
COPY --from=builder /go/src/github.com/ibm/ibm-block-csi-driver/bin/ibm-block-csi-node-driver .
COPY ./LICENSE /licenses/
COPY ./node/scripts/entrypoint.sh .
RUN chmod 755 ./entrypoint.sh
RUN mkdir /chroot
ADD chroot-host-wrapper.sh /chroot
RUN chmod 777 /chroot/chroot-host-wrapper.sh
RUN ln -s /chroot/chroot-host-wrapper.sh /chroot/blkid \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/blockdev \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/fsck \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/iscsiadm \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/iscsid \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/lsblk \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/lsscsi \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/mkfs.ext3 \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/mkfs.ext4 \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/mkfs.xfs \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/multipath \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/multipathd \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/mount \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/nvme \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/resize2fs \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/sg_inq \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/sg_map \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/umount \
&& ln -s /chroot/chroot-host-wrapper.sh /chroot/xfs_growfs
ENV PATH="/chroot:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ENTRYPOINT ["/root/entrypoint.sh"]