-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.07 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
# compile provisioner
FROM golang:1.26.2 AS provisioner
WORKDIR /usr/src/app
COPY nfs-subdir-external-provisioner ./
RUN go mod tidy && make
# compile nfsvol (mount manager / watchdog)
FROM golang:1.26.2 AS nfsvol
WORKDIR /usr/src/nfsvol
COPY nfsvol/ ./
RUN go mod tidy && go build -o /usr/local/bin/nfsvol .
#
# Upstream continuation of the old k8s.gcr.io/volume-nfs:0.8 image, maintained
# by the Kubernetes project at test/images/volume/nfs. CentOS Stream 9 base
# with nfs-utils already installed; we only need to add e2fsprogs for mkfs.ext4.
FROM rockylinux/rockylinux:10.1-minimal
RUN microdnf install -y \
e2fsprogs \
rpcbind \
nfs-utils \
&& microdnf clean all
COPY --from=provisioner /usr/src/app/bin/nfs-subdir-external-provisioner /usr/local/bin/nfs-subdir-external-provisioner
COPY --from=nfsvol /usr/local/bin/nfsvol /usr/local/bin/nfsvol
COPY resources/*.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/*.sh /usr/local/bin/nfsvol
RUN echo "/exports *(rw,fsid=0,insecure,no_subtree_check,no_root_squash,crossmnt)" > /etc/exports
CMD ["/usr/local/bin/run_nfs.sh"]