skip to Main Content

I would like to flatten a docker image by using docker multi-stage. My Dockerfile is something like this:

FROM nvcr.io/nvidia/l4t-tensorrt:r8.2.1-runtime as build

# ...

FROM scratch
COPY --from=build / /
CMD ["/bin/bash"]

However if I try to run this image (even if I use --runtime nvidia), the Nvidia libraries will not be mounted at runtime. How can I do it?

2

Answers


  1. Chosen as BEST ANSWER

    I solved by adding ENV instruction to the latest stage. The variables can be retrieved with docker inspect nvcr.io/nvidia/l4t-tensorrt:r8.2.1-runtime


  2. I’m trying to flatten a Docker image using Docker multi-stage build, with the intention of including Nvidia libraries at runtime. My Dockerfile looks something like this:

    Dockerfile
    Copy code
    FROM nvcr.io/nvidia/l4t-tensorrt:r8.2.1-runtime as build

    FROM scratch
    COPY –from=build / /
    CMD ["/bin/bash"]

    However, when I run the resulting image (even with the –runtime nvidia flag), the Nvidia libraries are not properly mounted at runtime. This means that the container cannot access the necessary Nvidia libraries, which results in errors or missing functionality.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search