java - 16-slim、16-jdk-slim、16-ea-slim docker 镜像有什么区别

标签 java spring-boot docker java-16

以下 Docker 镜像有什么区别?

  • openjdk:16-slim
  • openjdk:16-jdk-slim
  • openjdk:16-ea-slim

哪个体积更小并且可以在 Spring Boot 项目中使用?

最佳答案

区别在于使用的 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 与 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/

相关文章:

angularjs - 将文件上传到 Jhipster 中的目录

docker - 查找 `k8s.gcr.io/kubernetes-zookeeper:1.0-3.4.10` 的 Dockerfile 构建

java - IllegalArgumentException : invalid type for value: class android. widget.SeekBar

java - springApplicationAdminRegistrar : Invocation of init method failed: nested exception is javax. 管理.InstanceAlreadyExistsException

java - 如何使用 Apache POI 为 Excel 工作表中的行应用背景色?

java - 如何在不使用 DB 工具的情况下检测 Java 应用程序中的连接泄漏/打开连接

node.js - 使用 docker 时,npm 库不工作

networking - 如何获取客户端外部 ip,我使用 Gcloud/kubernetes

java - 如何在带有数据库的3表中使用ListSelectionListener

java - A* 探路者给出次优路径