Skip to content

ephemeral run: Fix missing libgcc.so errors in entrypoint#298

Open
petracvv wants to merge 1 commit into
bootc-dev:mainfrom
petracvv:missing_libgcc
Open

ephemeral run: Fix missing libgcc.so errors in entrypoint#298
petracvv wants to merge 1 commit into
bootc-dev:mainfrom
petracvv:missing_libgcc

Conversation

@petracvv

Copy link
Copy Markdown

In some host distributions not all system libraries are in the top-level /usr/lib and /usr/lib64 directories. Since we are mounting /usr from the host into the container, we need to account for that by also mounting the local ld.so.cache

Fixes #296

I don't think we need to worry about libraries in /opt as the bcvk binary has very minimal linking requirements:

❯ ldd ~/.local/bin/bcvk
        linux-vdso.so.1 (0x00007f499d3de000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/15/libgcc_s.so.1 (0x00007f499d382000)
        libm.so.6 => /usr/lib64/libm.so.6 (0x00007f499d26d000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007f499ca14000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f499d3e0000)

In some host distributions not all system libraries are in
the top-level /usr/lib and /usr/lib64 directories. Since
we are mounting /usr from the host into the container, we
need to account for that by also mounting the local ld.so.cache

Signed-off-by: Mihai Petracovici <petracvv@users.noreply.github.com>
ln -sf usr/lib64 lib64
ln -sf usr/sbin sbin
mkdir -p {etc,var,dev,proc,run,sys,tmp}
mkdir -p {var,dev,proc,run,sys,tmp}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mkdir -p etc should stay. It costs nothing and keeps the entrypoint self-contained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Entrypoint fails with libgcc_s.so.1: cannot open shared object file

2 participants