Hiya @seagullpat!
I’d recommend building a static version of your dependency that does not require the shared lib. We try to keep our default build image really small, and adding a bunch of shared libraries that are only needed by a few folks is something we try to avoid, since it will slow things down for everyone else as we have to transfer the build image around before building.
We are using at newest Xenial during build (could still be using Trusty, if you configured your site >2 years ago, here), so definitely don’t try bringing binaries from ubuntu 20 as that would be very unlikely to work before we upgrade again, which we are not planning to do very soon.
You are correct that you won’t be able to install things using apt, good intuition! My normal advice is to do what you’re doing: bring a binary built for the OS in question (which in most cases will be Xenial with an x86_64 architecture). Just make sure it doesn’t rely on optional libs (we have libc and some others, but png is not required for most other tools,. so may not be there)