gradle docker 映像的基本操作系统是什么?
What is the base operating system for a gradle docker image?
在我的 Docker 文件中,我使用:FROM gradle:6.8.0-jdk11-hotspot
我知道每个 docker 容器都运行某种虚拟机。因此它必须有一些操作系统(之前我使用 Alpine 作为基础映像)。使用 Gradle 图像作为基础,我不确定 OS 我的容器是什么 运行。我想这是一些标准,因为 gradle 图像的 Docker 中心页面没有详细说明,而且 gradle 本身不是 OS。
如何确定一些 docker 图像作为基础时的 OS?
你可以尝试拉取镜像,运行它,然后使用some of the commands/steps for knowing what Linux version you are using:
Use the following commands to get more details:
cat /etc/*release*
uname -a
$ docker pull gradle:6.8.0-jdk11-hotspot
...
Digest: sha256:13e62bd49f58d62c65672d6dfdcb79de3ffac01be8551f1d5cf44937c0776f86
Status: Downloaded newer image for gradle:6.8.0-jdk11-hotspot
docker.io/library/gradle:6.8.0-jdk11-hotspot
~$ docker run -it gradle:6.8.0-jdk11-hotspot bash
root@09e06441cc17:/home/gradle#
root@09e06441cc17:/home/gradle# uname -a
Linux 09e06441cc17 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@09e06441cc17:/home/gradle#
root@09e06441cc17:/home/gradle# cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
它看起来像是基于 Ubuntu 20.04.1 LTS (Focal Fossa)。
您也可以尝试从 Dockerfile 中追踪基础镜像。
- 来自 gradle Dockerhub page, there are links to each image tag's Dockerfile. The
6.8.0-jdk11-hotspot
links to this Dockerfile 的 FROM
行:
FROM adoptopenjdk:11-jdk-hotspot
- 从 adoptopenjdk Dockerhub page 中,我找不到 link 到
adoptopenjdk:11-jdk-hotspot
版本的 Dockerfile,但我认为它确实是 Ubuntu,如上所述该 Dockerhub 页面上的 Image Variants 部分:
Some of these tags may have names like focal in them. These are the suite code names for releases of Ubuntu and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.
您可以向上追踪 FROM
行,直到找到最终的基本图像。
gradle:6.8.0-jdk11-hotspot
's Dockerfile 有:
FROM adoptopenjdk:11-jdk-hotspot
adoptopenjdk:11-jdk-hotspot
's Dockerfile 有:
FROM ubuntu:20.04
AdoptOpenJDK's documentation 说:
Some of these tags may have names like focal in them. These are the suite code names for releases of Ubuntu and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.
ubuntu
's Docker Hub page 显示 20.04
是以下的别名:
20.04
, focal-20201106
, focal
, latest
But isn't Ubuntu somewhat bad to use as it is kind of large? Would it make more sense (space-wise) to use Alpine as base and installing gradle manually?
是的,Ubuntu 是一个大的基础图像。 AdoptOpenJDK 是否需要它,或者他们是出于方便而使用它?也许 Alpine 缺少他们需要的东西;也许他们需要 glibc 而不能使用 Alpine 的 musl 替代品;也许他们现在无法更改它,因为下游图像依赖于 Apt。我不知道。
在我的 Docker 文件中,我使用:FROM gradle:6.8.0-jdk11-hotspot
我知道每个 docker 容器都运行某种虚拟机。因此它必须有一些操作系统(之前我使用 Alpine 作为基础映像)。使用 Gradle 图像作为基础,我不确定 OS 我的容器是什么 运行。我想这是一些标准,因为 gradle 图像的 Docker 中心页面没有详细说明,而且 gradle 本身不是 OS。
如何确定一些 docker 图像作为基础时的 OS?
你可以尝试拉取镜像,运行它,然后使用some of the commands/steps for knowing what Linux version you are using:
Use the following commands to get more details:
cat /etc/*release*
uname -a
$ docker pull gradle:6.8.0-jdk11-hotspot
...
Digest: sha256:13e62bd49f58d62c65672d6dfdcb79de3ffac01be8551f1d5cf44937c0776f86
Status: Downloaded newer image for gradle:6.8.0-jdk11-hotspot
docker.io/library/gradle:6.8.0-jdk11-hotspot
~$ docker run -it gradle:6.8.0-jdk11-hotspot bash
root@09e06441cc17:/home/gradle#
root@09e06441cc17:/home/gradle# uname -a
Linux 09e06441cc17 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@09e06441cc17:/home/gradle#
root@09e06441cc17:/home/gradle# cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
它看起来像是基于 Ubuntu 20.04.1 LTS (Focal Fossa)。
您也可以尝试从 Dockerfile 中追踪基础镜像。
- 来自 gradle Dockerhub page, there are links to each image tag's Dockerfile. The
6.8.0-jdk11-hotspot
links to this Dockerfile 的FROM
行:FROM adoptopenjdk:11-jdk-hotspot
- 从 adoptopenjdk Dockerhub page 中,我找不到 link 到
adoptopenjdk:11-jdk-hotspot
版本的 Dockerfile,但我认为它确实是 Ubuntu,如上所述该 Dockerhub 页面上的 Image Variants 部分:Some of these tags may have names like focal in them. These are the suite code names for releases of Ubuntu and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.
您可以向上追踪 FROM
行,直到找到最终的基本图像。
gradle:6.8.0-jdk11-hotspot
's Dockerfile 有:FROM adoptopenjdk:11-jdk-hotspot
adoptopenjdk:11-jdk-hotspot
's Dockerfile 有:FROM ubuntu:20.04
AdoptOpenJDK's documentation 说:
Some of these tags may have names like focal in them. These are the suite code names for releases of Ubuntu and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Ubuntu.
ubuntu
's Docker Hub page 显示20.04
是以下的别名:20.04
,focal-20201106
,focal
,latest
But isn't Ubuntu somewhat bad to use as it is kind of large? Would it make more sense (space-wise) to use Alpine as base and installing gradle manually?
是的,Ubuntu 是一个大的基础图像。 AdoptOpenJDK 是否需要它,或者他们是出于方便而使用它?也许 Alpine 缺少他们需要的东西;也许他们需要 glibc 而不能使用 Alpine 的 musl 替代品;也许他们现在无法更改它,因为下游图像依赖于 Apt。我不知道。