I'm currently working on a microservices application that comprises four services, including an API gateway and a service registry. Each of these Docker images is around 500-600 MB, and I'm not sure why they're so large. I've tried a few things like switching from JDK to JRE, but there's been no noticeable improvement. I have a few specific questions: 1. Is a 500-600 MB image typical for such a small application or service? 2. If this size is excessive, what optimizations can I make? 3. Do heavier Docker images affect RAM usage directly?
1 Answer
It's tough to say if those sizes are normal without knowing more about your setup. You mentioned using Java and Spring, but the base images and frameworks matter too. If you’re able to share your Dockerfile for one of the services, that would help give better advice on potential causes for the size.

What additional info do you need? I'm using the Java Spring framework with a Maven build. Should I share my Dockerfile to clarify?