| I haven't used java in over a decade so won't be able to help much with that, but for example I was able to get my application to fit in just 70MB container including python and all dependencies + busybox and tini It looked something like this: https://gist.github.com/takeda/17b6b645ad4758d5aaf472b84447b... So what I did was: - link everything with musl - compile python and disable all packages that I didn't use in my application - trim boto3/botocore, to remove all stuff I did not use, that sucker on it's own is over 100MB The thing is what you need to understand is that the packages are primarily targeting the NixOS operating system, where in normal situation you have plenty of disk space, and you rather want all features to be available (because why not?). So you end up with bunch of dependencies, that you don't need. Alpine image for example was designed to be for docker, so the goal with all packages is to disable extra bells and whistles. This is why your result is bigger. To build a small image you will need to use override and disable all that unnecessary shit. Look at zulu for example: https://github.com/NixOS/nixpkgs/blob/master/pkgs/developmen... you add alsa, fontconfig (probably comes with entire X11), freetype, xorg (oh, nvm fontconfig, it's added explicitly), cups, gtk, cairo and ffmpeg) Notice how your friend carefully extracts and places only needed files in the container, while you just bundle the entire zulu package with all of its dependencies in your project. Edit: tadfisher seems to be more familiar with it than me, so I would start with that advice and modify code so it only includes a single jdk. Then things that I mentioned could cut the size of jdk further. Edit2: noticed another comment from tadfisher about openjdk_headless, so things might be even simpler than I thought. |