-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile-csi-node
78 lines (66 loc) · 3.23 KB
/
Dockerfile-csi-node
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
# Copyright IBM Corporation 2024.
#
# 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.20 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.4-949.1714662671
MAINTAINER IBM Storage
ARG VERSION=1.12.0
ARG BUILD_NUMBER=0
LABEL name="IBM block storage CSI driver node" \
vendor="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 ./NOTICES /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/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"]