#How do I decrease the size of my Rust container with NixPacks?

5 messages · Page 1 of 1 (latest)

thorn yacht
#

The bottom docker image is a image I built using a two stage approach where I have a builder image that moves the binary to the image that will be used. That results in an image size of 116 mb. When I run nixpacks build . --name my-app it doesn't do this kind of optimization so the image size is 2.26gb. What can I do to pare this image size down?

tawny sailBOT
#

Project ID: N/A

thorn yacht
#

N/A

#

I tried using

[phases.build]
cmds = ["...", "rm -rf target"]

in nixpacks.toml but it didn't work and threw this error.