-
Couldn't load subscription status.
- Fork 19
Using with docker images
Wojtek Czekalski edited this page Sep 5, 2023
·
1 revision
Adding nix-ld to docker images allows you to run pre-compiled binaries that depend on dynamic libraries inside docker images. To achieve that:
- Add
pkgs.nix-ldto your docker image - Set Env in the image like so:
"NIX_LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc ]}"
''NIX_LD=${pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"}''
- add
runAsRoot = ''
mkdir /lib64
ln -s /libexec/nix-ld /lib64/$(basename $(< ${pkgs.stdenv.cc}/nix-support/dynamic-linker))
'';