From 2ad58f152b76eea6b010f4f4e86472c1ec59385a Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 25 May 2020 14:24:12 +0200 Subject: [PATCH] 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 --- deploy/cephcsi/image/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/cephcsi/image/Dockerfile b/deploy/cephcsi/image/Dockerfile index 03b2adf12..de8da539d 100644 --- a/deploy/cephcsi/image/Dockerfile +++ b/deploy/cephcsi/image/Dockerfile @@ -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"]