I'm using temurin 17-jre-jammy docker image as a base and it should take ~90Mb of space.
My app currently takes 74Mb so resulting image must be around 164Mb. But it is 335Mb.
When I'm checking layers on Docker Desktop it says that 17-jre-jammy takes ~190Mb which corresponds with the 17 JDK
Why JRE layer takes 190Mb instead of 47?) How to fix that?
I tried to find sizes of layers for the 17-jre and on the docker hub it is correct: Image hierarchy eclipse-temurin:17-jre-jammy
I've got the source of confusion.
JDK and JRE size on the eclipse temurin site specifies the size of compressed files. After unarchiving it will take more place.
Same thing relates to docker 17-jre-jammy image - 90Mb it is compressed size of the image (it is mentioned just above the size). And after image downloading docker always performs extracting.
So I was referring to compressed size of docker and JDK/JRE while thinking it should be final size.