bell-sw / Liberica

Free and 100% open source Progressive Java Runtime for modern Java™ deployments supported by a leading OpenJDK contributor
https://bell-sw.com/pages/libericajdk/
GNU General Public License v2.0
299 stars 28 forks source link

[FR] For slim images remove docs, mans and other irrelevant files #164

Closed HectorB-2020 closed 4 months ago

HectorB-2020 commented 5 months ago

Hello! I was surprised to find plenty of files under /usr/share/man and /usr/share/doc/ In my view Debian-based images lack a few lines in its configs line below:

path-exclude=/usr/share/man/*
path-exclude=/usr/share/doc/*

Similar configuration exists for CentOS as well. So I'll appreciate of you consider leaving all docs/mans/infos aside for the sake of image slimness.

kholmanskikh commented 5 months ago

Hello.

Do you indeed use a slim image? Slim images contain slim in their tags:

https://hub.docker.com/r/bellsoft/liberica-runtime-container

and they do not contain docs or mans.

For example:

$ docker run -it --rm --pull always bellsoft/liberica-runtime-container:jre-17-slim-glibc
jre-17-slim-glibc: Pulling from bellsoft/liberica-runtime-container
Digest: sha256:d5d39e31a7f3bbba364cd399fbfff80534baa3d15b70a8ba5dc592905a6b1e88
Status: Image is up to date for bellsoft/liberica-runtime-container:jre-17-slim-glibc
/ # ls /usr/share/man
/ # ls /usr/share/doc
ls: /usr/share/doc: No such file or directory
/ # 
$ docker run -it --rm --pull always bellsoft/liberica-runtime-container:jre-21-slim-musl
jre-21-slim-musl: Pulling from bellsoft/liberica-runtime-container
9ef2473677bc: Pull complete 
Digest: sha256:2d8dd5817fbdb71664c35d78e08322cb9eec67348b915f5b3e8f3da130a1e037
Status: Downloaded newer image for bellsoft/liberica-runtime-container:jre-21-slim-musl
/ # ls -l /usr/share/doc
ls: /usr/share/doc: No such file or directory
/ # ls -l /usr/share/man
total 0
/ # 
$ docker run -it --rm --pull always bellsoft/liberica-runtime-container:jdk-21-slim-musl
jdk-21-slim-musl: Pulling from bellsoft/liberica-runtime-container
1b37ee72da30: Pull complete 
Digest: sha256:e65578c8186bcdb7bc391ac2d49173c325c42890b8ca51850d429b26d35f86f2
Status: Downloaded newer image for bellsoft/liberica-runtime-container:jdk-21-slim-musl
/ # ls -l /usr/share/man
total 0
/ # ls -l /usr/share/doc
ls: /usr/share/doc: No such file or directory
/ # 
HectorB-2020 commented 5 months ago

@kholmanskikh, thanks for pointing me to slim images with glibc. :+1: We're afraid of using Alpine-based images due to their problems with DNS resolution in k8s under certain circumstances, so we ruled to switching to Debian-based images, hence my initial question. So I wonder if you tested these images with glibc for various DNS cases.