My Profile Photo

Sheogorath's Blog

Static build perl

Today I learned how exactly one builds a “static” perl binary from a regular perl script using pp. While I have some experience writing perl scripts, it was semi fun to dive into it again after so many years, just to proof a point and build cowsay as a “distroless” container image.

I came across this after telling myself “Challenge accepted” due to a toot from Scott Williams and his cowsay container image. It only required 2 hours of debugging work, to figure out how the pp internal filesystem works and a little bit of standard tooling to make things happen. I also learned about some projects like distroless-perl, that I took some basic inspiration from e.g. to solve the libz and libcrypt dependencies, and in pp in general, which I didn’t know before.

podman run --rm quay.io/shivering-isles/cowsay:3.7.0 "Distroless Moo"
 ________________ 
< Distroless Moo >
 ---------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||