Skip to content

engine: configure registry push/pull with containerd#24213

Open
dvdksn wants to merge 1 commit intodocker:mainfrom
dvdksn:disable-push-registry
Open

engine: configure registry push/pull with containerd#24213
dvdksn wants to merge 1 commit intodocker:mainfrom
dvdksn:disable-push-registry

Conversation

@dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Feb 25, 2026

Signed-off-by: David Karlsson 35727626+dvdksn@users.noreply.github.com

@netlify
Copy link

netlify bot commented Feb 25, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 0ed696e
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/69a03dfcafe59f00084ffe25
😎 Deploy Preview https://deploy-preview-24213--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the area/engine Issue affects Docker engine/daemon label Feb 25, 2026
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the disable-push-registry branch from 49a658a to 0ed696e Compare February 26, 2026 12:35
@dvdksn dvdksn marked this pull request as ready for review February 26, 2026 12:35
Copy link
Contributor

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This is a well-written documentation page that clearly explains how to configure per-registry behavior using hosts.toml files with the containerd image store.

Strengths:

  • Clear structure with progressive examples (disable push → mirror → internal-only)
  • Proper front matter with all required fields
  • Accurate technical content with correct file paths and TOML syntax
  • Good use of tables for reference information
  • Appropriate callout explaining security limitations
  • Helpful section explaining interaction with daemon.json settings
  • Links to related documentation are valid

No issues found. The page follows Docker's documentation style guide and provides users with the information they need to configure registry access.

## hosts.toml format

Each `hosts.toml` file configures the behavior for one registry. The `server`
field sets the upstream registry URL. The `[host]` section configures specific
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The host acts as additional endpoints to try before the default endpoint. While it is true that is configures the endpoint, the ordering of these is important. In these examples, the server value and host both having the same value means the endpoint gets added twice, as a mirror and as a the default.

Every option under host can be defined at the top level for the "default" configuration. Unless configured multiple endpoints, host is not needed.

server = "https://registry-1.docker.io"

[host."https://registry-1.docker.io"]
capabilities = ["pull", "resolve"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be defined outside of host, as this is defined, the default server would be given the default capabilities which includes push.

capabilities = ["pull", "resolve"]

[host."https://registry-1.docker.io"]
capabilities = ["pull", "resolve", "push"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, if this is intending to default capabilities of the default endpoint, it should go right under server

access to all public registries:

```toml {title="/etc/docker/certs.d/docker.io/hosts.toml"}
server = "https://registry-1.docker.io"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct way to only support an internal registry. This server can just be set to the internal registry and no host provided at all.

| --------------------------------------- | ---------------------------- |
| `docker.io/myorg/myimage:latest` | `docker.io/` |
| `registry.example.com/myimage:latest` | `registry.example.com/` |
| `registry.example.com:5000/myimage:tag` | `registry.example.com:5000/` |
Copy link
Contributor

@dmcgowan dmcgowan Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows would define as registry.example.com_5000_

│ └── hosts.toml
└── registry.example.com:5000/
└── hosts.toml
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _default directory is worth mentioning as well, this allows a global default cache/mirror to be used. Either by setting server to override the default endpoint for all or adding a host entry which could always be tried first.

@dmcgowan
Copy link
Contributor

Sorry our docs can be a bit confusing and the use of it with "default" and "host" is a bit hard to follow. The idea was that the simple cases would just be updating defaults and possibly adding some mirrors. The amount of "features" that could be support via different permutations is part of the design, but not done in the easiest follow way. Parts of this are mentioned in https://github.com/containerd/containerd/blob/main/docs/hosts.md though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine Issue affects Docker engine/daemon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants