Skip to content

Registry

一句话解释

registry 是 storage and distribution service for 容器镜像 and 构建 artifacts.

用大白话说

A registry is a server that stores and distributes container images (and other artifacts). It is where you push images after building them, and where you pull images from when deploying.

Popular registries include Docker Hub (public, free for public images), Amazon ECR (AWS), Google Container Registry / Artifact Registry (GCP), and GitHub Container Registry. You can also run a private registry using the open-source Docker Distribution or tools like Harbor.

Registries version images using tags (e.g., myapp:1.2.3, myapp:latest). They also provide access control, so you can control who can push and pull images. Many registries also scan images for security vulnerabilities.

示例

bash
# Tag an image for a registry
docker tag myapp:1.0 registry.example.com/myapp:1.0

# Push to the registry
docker push registry.example.com/myapp:1.0

# Pull from the registry
docker pull registry.example.com/myapp:1.0

标签镜像使用 registry URL, 推送它 到存储它, and 拉取它 到 retrieve 它 on another machine.

工作原理

  1. You build an image and tag it with the registry URL.
  2. docker 推送 uploads the image to the registry.
  3. docker 拉取 downloads the image from the registry.
  4. The registry stores layers and provides versioning via tags.

常见混淆

  • 容易混淆的对象: 仓库

    关键区别: registry 是服务器那个存储镜像; 仓库 (in Docker 上下文) 是 named 集合的 tagged 镜像在内 registry.

相关术语

解读错误信息

用大白话解释常见错误——什么意思、为什么发生、如何修复。

查看错误

← 返回术语表