I'm comparing image I'm building directly with Docker file like such with Rust static executable inside it:
FROM scratch
COPY target/x86_64-unknown-linux-gnu/release/function /function
CMD [ "/function" ]
where I'm getting as output - image of about 14MB in size:
$ podman image ls | grep sample
localhost/sample latest 9f76d50aaa01 8 minutes ago 13.9 MB
and layers:
$ podman history sample
ID CREATED CREATED BY SIZE COMMENT
8144b031a549 8 minutes ago /bin/sh -c #(nop) CMD [ "/function" ] 0 B FROM 8144b031a549
<missing> 8 minutes ago /bin/sh -c #(nop) COPY file:3b28c741a95a71... 13.9 MB
And then I have image for same Rust function produced via buildpacks - about 107MB:
$ podman image ls | grep buildpack-sample
localhost/buildpack-sample latest 181d2f0215c3 43 years ago 107 MB
and layers in it:
$ podman history buildpack-sample
ID CREATED CREATED BY SIZE COMMENT
181d2f0215c3 43 years ago 3.07 kB
<missing> 43 years ago 4.1 kB
<missing> 43 years ago 2.31 MB
<missing> 43 years ago 2.56 kB
<missing> 43 years ago 362 kB
<missing> 43 years ago 27.6 kB
<missing> 43 years ago 12.8 MB
401511bdd9f6 43 years ago 2.56 kB
<missing> 43 years ago 4.61 kB
<missing> 43 years ago 4.1 kB
<missing> 43 years ago 25.9 MB
<missing> 43 years ago 3.07 kB
<missing> 43 years ago 3.07 kB
<missing> 43 years ago 65.5 MB
What is the cause of such big difference? Any specific setting/config to tweak somewhere to make it smaller via buildpacks as well?
Hi,
I'm comparing image I'm building directly with Docker file like such with Rust static executable inside it:
where I'm getting as output - image of about 14MB in size:
and layers:
And then I have image for same Rust function produced via buildpacks - about 107MB:
and layers in it:
What is the cause of such big difference? Any specific setting/config to tweak somewhere to make it smaller via buildpacks as well?