You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, if I do the same with a devbox Dockerfile generated with devbox generate dockerfile, and copy the binary into a base Debian or Ubuntu image, I get something like:
failed to open elf at /nix/store/5adwdl39g3k9a2j0qadvirnliv4r7pwd-glibc-2.39-52/lib/ld-linux-x86-64.so.2
What solution would you like?
I would like to be able to do something similar with the link above, where the devbox-dockerfile builds the rust binary, and then I can copy the binary in a fresh Dockerimage with nothing else.
Alternatives you've considered
I tried various other base-images like Debian, Ubuntu, jetpackio/devbox (without the installation part), but of course they don't work, as the rust binary is linked against the /nix/store/... glibc library.
The text was updated successfully, but these errors were encountered:
It takes the binary created by rust in devbox, uses patchelf to change the interpreter to the debian glibc, and creates a minimal docker image (including the certificates). This makes it 30MB instead of 980MB. I'd say it's a success :)
Of course I'd be happy to have a less patchy solution...
What problem are you trying to solve?
I want to create a minimal docker image to put my rust binary into. Usually one can do something like this for a minimal docker image:
https://dev.to/deciduously/use-multi-stage-docker-builds-for-statically-linked-rust-binaries-3jgd
Unfortunately, if I do the same with a devbox Dockerfile generated with
devbox generate dockerfile
, and copy the binary into a baseDebian
orUbuntu
image, I get something like:What solution would you like?
I would like to be able to do something similar with the link above, where the devbox-dockerfile builds the rust binary, and then I can copy the binary in a fresh Dockerimage with nothing else.
Alternatives you've considered
I tried various other base-images like
Debian
,Ubuntu
,jetpackio/devbox
(without the installation part), but of course they don't work, as the rust binary is linked against the/nix/store/...
glibc library.The text was updated successfully, but these errors were encountered: