-1

I built some software in a container (using Podman) and would like to run the binary on my host. The binary is linked to some dynamic libraries that I don't have on my host. I figured that a quick hacky solution is to mount the container's filesystem on my host and have the binary look for libraries in there (for instance using LD_LIBRARY_PATH).

How can I mount/see the container's filesystem on my host?

  • I think this is a case of https://xyproblem.info/ but have you tried [podman mount](http://docs.podman.io/en/latest/markdown/podman-mount.1.html)? –  Apr 15 '21 at 20:56

1 Answers1

0

Write custom packages to contain the program and its dependency libraries. rpm, deb, apk, whatever. Build these in a minimal chroot, such as mock to build rpm. Install on the host. Packaging like this has advantages including not requiring changing the linker.

If you really want to use that container image, would be more natural to reuse as the base of another container.

Yes, it is possible to mount the image somewhere, and maybe symlink the relevant libraries into /usr/local/lib64. However, that adds the complexity of a separate storage for this application, without the security benefits of a container (podman) or sandboxed application (snap, flatpak), with non-standard maintenance procedures.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34