Docker + Java Microservices: Choosing the Base Image for Java 8/9 Microservices (on Linux and Windows)
Defining the base image is one of the most important decisions when creating docker containers. Here I will describe some of the reasoning when you do that for Java Spring Boot Microservices.
Introduction
Containers were designed to be self-contained and isolated. However, the environment in which it runs does affect the decision on what base image you should use.
You may run on a Windows machine that is already running Linux Docker Containers. Or the machine is running only windows containers (or no containers at all). Or maybe you are even thinking about running a Linux container on the same Windows Server. There are relevant questions on what Java base image you should choose.
In this article, I will share some of the things I learned along the way on how to make those decisions, and how to justify them to your Devops department.
Note: If you haven't yet learned how to create a Java Spring Boot Microservice, I recommend you this reading: Docker + Spring Boot Microservice (with Gradle).
Quick pick on Docker Layers
It would be wasteful to go too much into detail about how Docker Layers work due…