I made a CLI tool 7 years ago that you simply run:
containerize <your app here> <your arguments here>
and it generates a Docker image from scratch without any base image at all. So you can get down to 4MB in size and the like. It uses LDD to collect all dependencies the binary needs.