GithubHelp home page GithubHelp logo

Comments (6)

norrisjeremy avatar norrisjeremy commented on August 15, 2024 1

Hi @cjdcordeiro,

I've confirmed 631f156 fixes the issue I was having, thanks!

Thanks,
Jeremy

from chisel-releases.

cjdcordeiro avatar cjdcordeiro commented on August 15, 2024

Hi.

the dash package has changed in 24.04 and the binaries are now located at /usr/bin. See https://github.com/canonical/chisel-releases/blob/ubuntu-24.04/slices/dash.yaml#L8-L9

from chisel-releases.

norrisjeremy avatar norrisjeremy commented on August 15, 2024

Hi @cjdcordeiro,

Please reopen this, as that's not the issue.
/bin is a symlink pointing to /usr/bin, so executing /bin/sh is perfectly fine.

I've actually tracked down the issue.
The problem is that when /bin/sh is exec'd, it attempts to open /lib64/ld-linux-x86-64.so.2.
This no longer exists in 24.04, as the actual path is now /usr/lib64/ld-linux-x86-64.so.2.
For regular 24.04, this is handled fine because /lib64 is a symlink pointing to usr/lib64.
However, with the chisel'd container I'm creating in the example Dockerfiles, /lib64 is created as a now empty directory, instead of being a symlink to usr/lib64 as it should be.

Thanks,
Jeremy

from chisel-releases.

norrisjeremy avatar norrisjeremy commented on August 15, 2024

Hi @cjdcordeiro,

Please reopen this, as that's not the issue. /bin is a symlink pointing to /usr/bin, so executing /bin/sh is perfectly fine.

I've actually tracked down the issue. The problem is that when /bin/sh is exec'd, it attempts to open /lib64/ld-linux-x86-64.so.2. This no longer exists in 24.04, as the actual path is now /usr/lib64/ld-linux-x86-64.so.2. For regular 24.04, this is handled fine because /lib64 is a symlink pointing to usr/lib64. However, with the chisel'd container I'm creating in the example Dockerfiles, /lib64 is created as a now empty directory, instead of being a symlink to usr/lib64 as it should be.

Thanks, Jeremy

Sorry, I misspoke slightly: the symlink for /lib64 pointing to usr/lib64 is missing entirely.
If I manually add it, then everything works:

FROM ubuntu:22.04 AS chisel
ADD https://github.com/canonical/chisel/releases/download/v0.9.0/chisel_v0.9.0_linux_amd64.tar.gz chisel.tar.gz
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates && \
    tar -xvf chisel.tar.gz -C /usr/bin/ && \
    mkdir -p /rootfs && \
    chisel cut --release ubuntu-24.04 --root /rootfs \
      base-files_base \
      base-files_release-info \
      base-passwd_data \
      libc6_config \
      libc6_libs \
      libgcc-s1_libs \
      dash_bins
RUN ln -s usr/lib64 /rootfs/lib64

FROM scratch
COPY --from=chisel /rootfs /
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["echo foo"]
$ docker build . -t foo:2 && docker run -it --rm foo:2
...
foo

from chisel-releases.

norrisjeremy avatar norrisjeremy commented on August 15, 2024

Something like this would fix it I think:

diff --git a/slices/libc6.yaml b/slices/libc6.yaml
index 5f67118..7310473 100644
--- a/slices/libc6.yaml
+++ b/slices/libc6.yaml
@@ -28,3 +28,4 @@ slices:
       /usr/lib/*-linux-*/libthread_db.so.*:
       /usr/lib/*-linux-*/libutil.so.*:
       /usr/lib*/ld*.so.*:
+      /lib64:

from chisel-releases.

cjdcordeiro avatar cjdcordeiro commented on August 15, 2024

Hi @norrisjeremy

indeed, apologies, I missed the fact that you were installing base-files_base. /lib64 should indeed be there.

This PR fixes the issue: #154 (tested with your Dockerfile and seems to be working)

from chisel-releases.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.