以下 Docker 镜像有什么区别?
-
openjdk:16-slim
-
openjdk:16-jdk-slim
-
openjdk:16-ea-slim
哪个体积更小并且可以在 Spring Boot 项目中使用?
最佳答案
区别在于使用的 Java 版本,因此压缩大小也不同(下面的链接):
- openjdk:16-slim压缩大小
198.93 MB
使用16.0.1
- openjdk:16-jdk-slim压缩大小
198.93 MB
使用16.0.1
- openjdk:16-ea-slim压缩大小
198.82 MB
使用16-ea+34
(抢先体验)
您正确地注意到,除了哈希值之外,openjdk:16-slim
和 openjdk: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 与 Java 16 结合使用,则需要使用当前最新版本(截至 2021 年 5 月)的 Spring Boot 2.5.0
或更新的。欲了解更多信息,请访问 Spring Boot 2.5 is now GA .
关于java - 16-slim、16-jdk-slim、16-ea-slim docker 镜像有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67666230/