16-slim, 16-jdk-slim, 16-ea-slim docker 图像有什么区别

What is the difference between 16-slim, 16-jdk-slim, 16-ea-slim docker images

以下Docker张图片有什么区别?

哪个体积更小,可以在 Spring 引导项目中使用?

不同之处在于所使用的 Java 版本以及压缩后的大小(链接如下):

您正确地注意到 openjdk:16-slimopenjdk:16-jdk-slim 除了哈希值之外没有区别。我假设有两个相同的图像以尊重新的命名约定(我的猜测)。

如果您参考 openjdk DockerHub description | Image Variants,您可能会发现以下内容:

The openjdk images come in many flavors, each designed for a specific use case.

openjdk:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

重要提示: 如果您决定使用 Spring Boot with Java 16,则需要使用当前最新版本(截至 2021 年 5 月) ) Spring 启动 2.5.0 or newer. Read more at Spring Boot 2.5 is now GA.