build: verify that all dynamically linked libraries are available

When building with go-ceph, there are several dynamically linked
libraries used directly (libcephfs, librados and librbd), and many more
indirectly.

By adding an additional RUN statement to check if all libraries are
available in the final image, problems related to missing libraries
should be caught before publishing/consuming the image.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-05-25 14:24:12 +02:00 committed by mergify[bot]
parent 3d0395d448
commit 2ad58f152b

View File

@ -48,4 +48,7 @@ LABEL maintainers="Ceph-CSI Authors" \
COPY --from=builder ${SRC_DIR}/_output/cephcsi /usr/local/bin/cephcsi
# verify that all dynamically linked libraries are available
RUN [ $(ldd /usr/local/bin/cephcsi | grep -c '=> not found') = '0' ]
ENTRYPOINT ["/usr/local/bin/cephcsi"]