From 4cc0368c871ec8cd0091a19c1d79059e623eb661 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 19 Oct 2026 17:22:28 -0700 Subject: [PATCH] Dockerfile: use ldconfig for dynamic libraries The libseccomp and libpathrs libraries built by Dockerfile are installed into $DYLIB_DIR/lib, which is only made known to the dynamic linker via LD_LIBRARY_PATH. Yet runc init is executed with a clean environment, so it can not find libpathrs.so.0 and dies, resulting in unable to start container process: can't copy bootstrap data to pipe: write init-p: broken pipe As a result, "make integration" and some of "make unittest" fail. Use ldconfig instead of LD_LIBRARY_PATH. This went unnoticed because CI only builds the image, and never runs tests in it. Add a quick smoke test (run.bats) to the release job, which is the only one that builds the image. Signed-off-by: Kir Kolyshkin --- .github/workflows/validate.yml | 2 ++ Dockerfile | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1b8edc3ea..8d009eb39 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -305,6 +305,8 @@ jobs: # needs it. - name: build docker image run: make runcimage + - name: smoke test docker image + run: make integration TESTPATH=/run.bats - name: make releaseall run: make releaseall - name: upload artifacts diff --git a/Dockerfile b/Dockerfile index bfe0a6cba..e70184bd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,7 +75,9 @@ RUN mkdir -p $DYLIB_DIR \ && /tmp/script/build-libpathrs.sh "$LIBPATHRS_VERSION" $DYLIB_DIR $RELEASE_ARCHES ENV LIBPATHRS_VERSION=$LIBPATHRS_VERSION -ENV LD_LIBRARY_PATH=$DYLIB_DIR/lib +# Use ldconfig rather than LD_LIBRARY_PATH, since runc init does not inherit +# the environment. +RUN echo "$DYLIB_DIR/lib" > /etc/ld.so.conf.d/runc-dylibs.conf && ldconfig ENV PKG_CONFIG_PATH=$DYLIB_DIR/lib/pkgconfig # Prevent the "fatal: detected dubious ownership in repository" git complain during build.