📦docker-library / official-images
← 返回首页
Primary source of truth for the Docker "Official Images" program
⚖️ Apache-2.0🌐 hub.docker.com📅 创建于 2013-10-17🔄 更新于 2026-10-30
🔗 GitHub Shell

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Docker Official Images

Table of Contents

  1. Docker Official Images
    1. Table of Contents
    2. What are "Official Images"?
    3. Architectures other than amd64?
    4. More FAQs?
    5. Contributing to the standard library
      1. Review Guidelines
        1. Maintainership
        2. Repeatability
        3. Consistency
        4. Clarity
        5. init
        6. Cacheability
        7. Security
          1. Image Build
          2. Runtime Configuration
          3. Security Releases
        8. Multiple Architectures
      2. Commitment
    6. Library definition files
      1. Filenames
      2. Tags and aliases
      3. Instruction format
      4. Creating a new repository
      5. Adding a new tag in an existing repository (that you're the maintainer of)
      6. Change to a tag in an existing repository (that you're the maintainer of)
    7. Bashbrew

What are "Official Images"?

The Docker Official Images are curated images hosted on Docker Hub. The main tenets are:

See Docker's documentation for a good high-level overview of the program.

In essence we strive to heed upstream's recommendations on how they intend for their software to be consumed. Many images are maintained in collaboration with the relevant upstream project if not maintained directly by them. Additionally we aim to exemplify the best practices for Dockerfiles to serve as a reference when making or deriving your own images from them.

(If you are a representative of an upstream for which there exists an image and you would like to get involved, please see the Maintainership section below!)

Architectures other than amd64?

Some images have been ported for other architectures, and many of these are officially supported (to various degrees).

  • Architectures officially supported by Docker, Inc. for running Docker: (see download.docker.com)
    • ARMv6 32-bit (arm32v6): https://hub.docker.com/u/arm32v6/
    • ARMv7 32-bit (arm32v7): https://hub.docker.com/u/arm32v7/
    • ARMv8 64-bit (arm64v8): https://hub.docker.com/u/arm64v8/
    • Linux x86-64 (amd64): https://hub.docker.com/u/amd64/
    • Windows x86-64 (windows-amd64): https://hub.docker.com/u/winamd64/
  • Other architectures built by official images: (but not officially supported by Docker, Inc.)
    • ARMv5 32-bit (arm32v5): https://hub.docker.com/u/arm32v5/
    • IBM POWER8 (ppc64le): https://hub.docker.com/u/ppc64le/
    • IBM z Systems (s390x): https://hub.docker.com/u/s390x/
    • RISC-V 64-bit (riscv64): https://hub.docker.com/u/riscv64/
    • x86/i686 (i386): https://hub.docker.com/u/i386/

These other architectures are included under the non-prefixed images via OCI "image indexes", such that, for example, docker run hello-world should run as-is on all supported platforms.

If you're curious about how these are built, head over to our FAQ entry to see an explanation of the process or visit meta-scripts to see the build process source files.

See the multi-arch section below for recommendations in adding more architectures to an official image.

More FAQs?

Yes! We have a dedicated FAQ repository where we try to collect other common questions (both about the program and about our practices).

Contributing to the standard library

Thank you for your interest in the Docker official images project! We strive to make these instructions as simple and straightforward as possible, but if you find yourself lost, don't hesitate to seek us out on Libera.Chat IRC in channel #docker-library or by creating a GitHub issue here.

Be sure to familiarize yourself with Official Repositories on Docker Hub and the Best practices for writing Dockerfiles in the Docker documentation. These will be the foundation of the review process performed by the official images maintainers. If you'd like the review process to go more smoothly, please ensure that your Dockerfiles adhere to all the points mentioned there, as well as below, before submitting a pull request.

Also, the Hub descriptions for these images are currently stored separately in the docker-library/docs repository, whose README.md file explains more about how it's structured and how to contribute to it. Please be prepared to submit a PR there as well, pending acceptance of your image here.

Review Guidelines

Because the official images are intended to be learning tools for those new to Docker as well as the base images for advanced users to build their production releases, we review each proposed Dockerfile to ensure that it meets a minimum standard for quality and maintainability. While some of that standard is hard to define (due to subjectivity), as much as possible is defined here, while also adhering to the "Best Practices" where appropriate.

A checklist which may be used by the maintainers during review can be found in NEW-IMAGE-CHECKLIST.md.

Maintainership

Version bumps and security fixes should be attended to in a timely manner.

If you do not represent upstream and upstream becomes interested in maintaining the image, steps should be taken to ensure a smooth transition of image maintainership over to upstream.

For upstreams interested in taking over maintainership of an existing repository, the first step is to get involved in the existing repository. Making comments on issues, proposing changes, and making yourself known within the "image community" (even if that "community" is just the current maintainer) are all important places to start to ensure that the transition is unsurprising to existing contributors and users.

When taking over an existing repository, please ensure that the entire Git history of the original repository is kept in the new upstream-maintained repository to make sure the review process isn't stalled during the transition. This is most easily accomplished by forking the new from the existing repository, but can also be accomplished by fetching the commits directly from the original and pushing them into the new repo (ie, git fetch https://github.com/jsmith/example.git master, git rebase FETCH_HEAD, git push -f). On GitHub, an alternative is to move ownership of the git repository. This can be accomplished without giving either group admin access to the other owner's repository:

  • create temporary intermediary organization
  • give old and new owners admin access to intermediary organization
  • old owner transfers repo ownership to intermediary organization
  • new owner transfers repo ownership to its new home
    • recommend that old owner does not fork new repo back into the old organization to ensure that GitHub redirects will just work

Repeatability

Rebuilding the same Dockerfile should result in the same version of the image being packaged, even if the second build happens several versions later, or the build should fail outright, such that an inadvertent rebuild of a Dockerfile tagged as 0.1.0 doesn't end up containing 0.2.3. For example, if using apt to install the main program for the image, be sure to pin it to a specific version (ex: ... apt-get install -y my-package=0.1.0 ...). For dependent packages installed by apt there is not usually a need to pin them to a version.

No official images can be derived from, or depend on, non-official images (allowing the non-image scratch and the intentionally limited exceptions pinned in .external-pins -- see also .external-pins/list.sh).

Consistency

All official images should provide a consistent interface. A beginning user should be able to docker run official-image bash (or sh) without needing to learn about --entrypoint. It is also nice for advanced users to take advantage of entrypoint, so that they can docker run official-image --arg1 --arg2 without having to specify the binary to execute.

  1. If the startup process does not need arguments, just use CMD:

    Dockerfile CMD ["irb"]

  2. If there is initialization that needs to be done on start, like creating the initial database, use an ENTRYPOINT along with CMD:

    Dockerfile ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["postgres"]

    1. Ensure that docker run official-image bash (or sh) works too. The easiest way is to check for the expected command and if it is something else, just exec "$@" (run whatever was passed, properly keeping the arguments escaped).

      ```sh

      !/bin/sh

      set -e

      this if will check if the first argument is a flag

      but only works if all arguments require a hyphenated flag

      -v; -SL; -f arg; etc will work, but not arg1 arg2

      if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then set -- mongod "$

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR