Skip to content

Commit 75d38c8

Browse files
authored
Adds missing NFS protocols
1 parent 217fa4b commit 75d38c8

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

Dockerfile

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ ARG DEPS_IMAGE=alpine:3
55
FROM --platform=linux/${ARCH} $DEPS_IMAGE AS deps
66

77
ARG DEPS_IMAGE
8+
ARG BIN=trident_orchestrator
9+
ARG CLI_BIN=tridentctl
10+
ARG CHWRAP_BIN=chwrap.tar
11+
ARG NODE_PREP_BIN=node_prep
12+
ARG SYSWRAP_BIN=syswrap
813

914
# Installs nfs-utils based on DEPS_IMAGE
1015
RUN --mount=type=secret,id=activation_key,env=ACTIVATION_KEY \
@@ -14,39 +19,31 @@ RUN --mount=type=secret,id=activation_key,env=ACTIVATION_KEY \
1419
then apk add nfs-utils; \
1520
else subscription-manager register --activationkey $ACTIVATION_KEY --org $ORGANIZATION && \
1621
yum install --repo=rhel-9-*-baseos-rpms -y nfs-utils || { cat /var/log/rhsm/rhsm.log; exit 1; } \
17-
fi; \
18-
# Copy real certificates \
19-
mkdir /real-certs; \
20-
cp -L /etc/ssl/certs/* /real-certs/
22+
fi;
23+
24+
# Copy dependencies to the root filesystem
25+
RUN for dep in /bin/mount /bin/umount /sbin/mount.nfs /sbin/mount.nfs4 /etc/netconfig /etc/protocols /etc/ssl/certs/*; do \
26+
mkdir -p /rootfs/$(dirname $dep) && cp -L $dep /rootfs/$dep; \
27+
done
2128

22-
# Get the mount.nfs4 dependency
23-
RUN ldd /sbin/mount.nfs4 | tr -s '[:space:]' '\n' | grep '^/' | xargs -I % sh -c 'mkdir -p /nfs-deps/$(dirname %) && cp -L % /nfs-deps/%'
24-
RUN ldd /sbin/mount.nfs | tr -s '[:space:]' '\n' | grep '^/' | xargs -I % sh -c 'mkdir -p /nfs-deps/$(dirname %) && cp -r -u -L % /nfs-deps/%'
29+
# Copy NFS dependencies to the root filesystem
30+
RUN for bin in /sbin/mount.nfs /sbin/mount.nfs4; do \
31+
ldd $bin | tr -s '[:space:]' '\n' | grep '^/' | xargs -I % sh -c 'mkdir -p /rootfs/$(dirname %) && cp -L % /rootfs/%'; \
32+
done
33+
34+
COPY ${BIN} /rootfs/trident_orchestrator
35+
COPY ${CLI_BIN} /rootfs/bin/tridentctl
36+
COPY ${NODE_PREP_BIN} /rootfs/node_prep
37+
COPY ${SYSWRAP_BIN} /rootfs/syswrap
38+
ADD ${CHWRAP_BIN} /rootfs/
2539

2640
FROM scratch
2741

2842
LABEL maintainers="The NetApp Trident Team" \
2943
app="trident.netapp.io" \
3044
description="Trident Storage Orchestrator"
3145

32-
COPY --from=deps /bin/mount /bin/umount /bin/
33-
COPY --from=deps /sbin/mount.nfs /sbin/mount.nfs4 /sbin/
34-
COPY --from=deps /etc/netconfig /etc/
35-
COPY --from=deps /nfs-deps/ /
36-
37-
COPY --from=deps /real-certs/ /etc/ssl/certs/
38-
39-
ARG BIN=trident_orchestrator
40-
ARG CLI_BIN=tridentctl
41-
ARG CHWRAP_BIN=chwrap.tar
42-
ARG NODE_PREP_BIN=node_prep
43-
ARG SYSWRAP_BIN=syswrap
44-
45-
COPY ${BIN} /trident_orchestrator
46-
COPY ${CLI_BIN} /bin/tridentctl
47-
COPY ${NODE_PREP_BIN} /node_prep
48-
COPY ${SYSWRAP_BIN} /syswrap
49-
ADD ${CHWRAP_BIN} /
46+
COPY --from=deps /rootfs /
5047

5148
ENTRYPOINT ["/bin/tridentctl"]
5249
CMD ["version"]

0 commit comments

Comments
 (0)