-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (59 loc) · 1.68 KB
/
Dockerfile
File metadata and controls
71 lines (59 loc) · 1.68 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
# Copyright 2019 Hammerspace
# ---------- Stage 1: Builder ----------
FROM rockylinux/rockylinux:9-ubi AS builder
# Install build tools
RUN dnf -y update && \
dnf -y install python3-pip git golang make && \
dnf clean all
# Install hstk (Python 3 version)
RUN python3 -m pip install --no-cache-dir --user hstk
ENV PATH=$PATH:/root/.local/bin
# Set working directory
WORKDIR /go/src/github.com/hammer-space/csi-plugin/
# Add source code
ADD . ./
# Build plugin
RUN make compile
# ---------- Stage 2: Runtime ----------
FROM rockylinux/rockylinux:9-ubi
# Enable `devel` repo to access libverto-libevent
RUN dnf --nodocs --nobest -y install \
dnf-plugins-core && \
dnf config-manager --set-enabled devel && \
dnf -y update && \
dnf -y install \
util-linux \
python3-pip \
libcom_err-devel \
ca-certificates \
e2fsprogs \
e2fsprogs-libs \
gssproxy \
keyutils-libs \
keyutils \
libbasicobjects \
libcollection \
libini_config \
libnfsidmap \
nfs-utils \
libref_array \
libverto-libevent \
qemu-img \
quota \
quota-nls \
rpcbind \
xfsprogs && \
dnf clean all && \
rm -rf /var/cache/dnf
# Install hstk using pip3
RUN python3 -m pip install --no-cache-dir --user hstk
ENV PATH=$PATH:/root/.local/bin
# Set working directory
WORKDIR /hs-csi-plugin/
# Copy CSI plugin binary from build stage
COPY --from=builder /go/src/github.com/hammer-space/csi-plugin/bin/hs-csi-plugin .
# Include license files
COPY LICENSE .
COPY DEPENDENCY_LICENSES .
# Set entrypoint to the plugin binary
ENTRYPOINT ["/hs-csi-plugin/hs-csi-plugin"]