An optimized build of jre can be created using jlink and then we can copy the output into an docker image.
Let us create a new Dockerfile named Optimized.Dockerfile while keeping the old one and add instructions into the optimized version for a minimal build.
When trying out an image with another name than Dockerfile we must tell docker build what filename to use.
docker build -f Optimized.Dockerfile .