1
0
mirror of https://github.com/opencontainers/runc.git synced 2026-10-23 19:49:01 +03:00

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 <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2026-10-19 17:22:28 -07:00
committed by lfbzhm
parent 976d95abc4
commit 4cc0368c87
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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.