“Hello World!”是一个经典的入门示例,具体而言是最小化Docker化的范例,它通过简单的应用展示了如何利用Docker将程序打包为容器,涵盖基础的镜像构建与容器运行流程,适合初学者快速理解Docker的核心概念及基本操作,直观体现了Docker化的简洁性与入门友好性。

2.6千 次收藏下载次数: 0状态:Docker 官方镜像维护者:Docker 官方镜像仓库类型:镜像最近更新:
下载命令
点击查看

Quick reference

  • Maintained by:
    https://github.com/docker-library/hello-world

  • Where to get help:
    https://dockr.ly/comm-slack, Server Fault, https://unix.stackexchange.com/help/on-topic, or https://stackoverflow.com/help/on-topic

Supported tags and respective Dockerfile links

(See https://github.com/docker-library/faq#whats-the-difference-between-shared-and-simple-tags.)

Simple Tags

  • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/Dockerfile

  • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/nanoserver-ltsc2025/Dockerfile

  • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/nanoserver-ltsc2022/Dockerfile

Shared Tags

  • latest:

    • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/Dockerfile
    • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/nanoserver-ltsc2025/Dockerfile
    • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/nanoserver-ltsc2022/Dockerfile
  • nanoserver:

    • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/nanoserver-ltsc2025/Dockerfile
    • https://github.com/docker-library/hello-world/blob/3981a44a531e7c844d844e12cbbda232d10d5dfb/amd64/nanoserver-ltsc2022/Dockerfile

Quick reference (cont.)

  • Where to file issues:
    https://github.com/docker-library/hello-world/issues?q=is:issue+is:pr

  • Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
    https://hub.docker.com/r/amd64/hello-world/, https://hub.docker.com/r/arm32v5/hello-world/, https://hub.docker.com/r/arm32v6/hello-world/, https://hub.docker.com/r/arm32v7/hello-world/, https://hub.docker.com/r/arm64v8/hello-world/, https://hub.docker.com/r/i386/hello-world/, https://hub.docker.com/r/ppc64le/hello-world/, https://hub.docker.com/r/riscv64/hello-world/, https://hub.docker.com/r/s390x/hello-world/, https://hub.docker.com/r/winamd64/hello-world/

  • Published image artifact details:
    https://github.com/docker-library/repo-info/blob/master/repos/hello-world (https://github.com/docker-library/repo-info/commits/master/repos/hello-world)
    (image metadata, transfer size, etc)

  • Image updates:
    https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fhello-world
    https://github.com/docker-library/official-images/blob/master/library/hello-world (https://github.com/docker-library/official-images/commits/master/library/hello-world)

  • Source of this description:
    https://github.com/docker-library/docs/tree/master/hello-world (https://github.com/docker-library/docs/commits/master/hello-world)

Example output

console
$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/


$ docker images hello-world
REPOSITORY    TAG       IMAGE ID       SIZE
hello-world   latest    e2ac70e7319a   10.07kB

How is this image created?

This image is a prime example of using the https://hub.docker.com/_/scratch/ image effectively. See https://github.com/docker-library/hello-world/blob/master/hello.c in https://github.com/docker-library/hello-world for the source code of the hello binary included in this image.

Because this image consists of nothing but a single static binary which prints some text to standard output, it can trivially be run as any arbitrary user (docker run --user $RANDOM:$RANDOM hello-world, for example).

License

View https://github.com/docker-library/hello-world/blob/master/LICENSE for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/hello-world.

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 hello-world 镜像标签

docker pull docker.xuanyuan.run/hello-world:<标签>

DockerHub 原生拉取命令

docker pull hello-world:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告