Skip to content

Commit 3d363df

Browse files
authored
Merge pull request #45788 from sergeyshevch/feat/update-image-name-documentation
feat: Update image name documentation
2 parents 6742e9c + 9105838 commit 3d363df

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

content/en/docs/concepts/containers/images.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,36 @@ Container images are usually given a name such as `pause`, `example/mycontainer`
3333
Images can also include a registry hostname; for example: `fictional.registry.example/imagename`,
3434
and possibly a port number as well; for example: `fictional.registry.example:10443/imagename`.
3535

36-
If you don't specify a registry hostname, Kubernetes assumes that you mean the Docker public registry.
36+
If you don't specify a registry hostname, Kubernetes assumes that you mean the [Docker public registry](https://hub.docker.com/).
37+
You can change this behaviour by setting default image registry in
38+
[container runtime](/docs/setup/production-environment/container-runtimes/) configuration.
3739

38-
After the image name part you can add a _tag_ (in the same way you would when using with commands
39-
like `docker` or `podman`). Tags let you identify different versions of the same series of images.
40+
After the image name part you can add a _tag_ or _digest_ (in the same way you would when using with commands
41+
like `docker` or `podman`). Tags let you identify different versions of the same series of images.
42+
Digests are a unique identifier for a specific version of an image. Digests are hashes of the image's content,
43+
and are immutable. Tags can be moved to point to different images, but digests are fixed.
4044

4145
Image tags consist of lowercase and uppercase letters, digits, underscores (`_`),
42-
periods (`.`), and dashes (`-`).
43-
There are additional rules about where you can place the separator
44-
characters (`_`, `-`, and `.`) inside an image tag.
46+
periods (`.`), and dashes (`-`). It can be up to 128 characters long. And must follow the
47+
next regex pattern: `[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127}`
48+
You can read more about and find validation regex in the
49+
[OCI Distribution Specification](https://github.com/opencontainers/distribution-spec/blob/master/spec.md#workflow-categories).
4550
If you don't specify a tag, Kubernetes assumes you mean the tag `latest`.
4651

52+
Image digests consists of a hash algorithm (such as `sha256`) and a hash value. For example:
53+
`sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07`
54+
You can find more information about digests format in the
55+
[OCI Image Specification](https://github.com/opencontainers/image-spec/blob/master/descriptor.md#digests).
56+
57+
Some image name examples that Kubernetes can use are:
58+
59+
- `busybox` - Image name only, no tag or digest. Kubernetes will use Docker public registry and latest tag. (Same as `docker.io/library/busybox:latest`)
60+
- `busybox:1.32.0` - Image name with tag. Kubernetes will use Docker public registry. (Same as `docker.io/library/busybox:1.32.0`)
61+
- `registry.k8s.io/pause:latest` - Image name with a custom registry and latest tag.
62+
- `registry.k8s.io/pause:3.5` - Image name with a custom registry and non-latest tag.
63+
- `registry.k8s.io/pause@sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07` - Image name with digest.
64+
- `registry.k8s.io/pause:3.5@sha256:1ff6c18fbef2045af6b9c16bf034cc421a29027b800e4f9b68ae9b1cb3e9ae07` - Image name with tag and digest. Only digest will be used for pulling.
65+
4766
## Updating images
4867

4968
When you first create a {{< glossary_tooltip text="Deployment" term_id="deployment" >}},

0 commit comments

Comments
 (0)