4.8. Tagging images
Use the podman tag command to add an additional name to a local image. This additional name can consist of several parts: <registryhost>/<username>/<name>:<tag>.
Prerequisites
-
The
container-toolsmeta-package is installed. - A pulled image is available on the local system.
Procedure
List all images:
$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.redhat.io/ubi10/ubi latest 3269c37eae33 7 weeks ago 208 MBAssign the
myubiname to theregistry.redhat.io/ubi10/ubiimage using one of the following options:The image name:
$ podman tag registry.redhat.io/ubi10/ubi myubiThe image ID:
$ podman tag 3269c37eae33 myubiBoth commands give you the same result.
List all images:
$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.redhat.io/ubi10/ubi latest 3269c37eae33 2 months ago 208 MB localhost/myubi latest 3269c37eae33 2 months ago 208 MBNotice that the default tag is
latestfor both images. You can see all the image names are assigned to the single image ID 3269c37eae33.Add the
10tag to theregistry.redhat.io/ubi10/ubiimage using either:The image name:
$ podman tag registry.redhat.io/ubi10/ubi myubi:10The image ID:
$ podman tag 3269c37eae33 myubi:10Both commands give you the same result.
Verification
List all images:
$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.redhat.io/ubi10/ubi latest 3269c37eae33 2 months ago 208 MB localhost/myubi latest 3269c37eae33 2 months ago 208 MB localhost/myubi 10 3269c37eae33 2 months ago 208 MBNotice that the default tag is
latestfor both images. You can see all the image names are assigned to the single image ID 3269c37eae33.
After tagging the registry.redhat.io/ubi10/ubi image, you have three options to run the container:
-
by ID (
3269c37eae33) -
by name (
localhost/myubi:latest) by name (
localhost/myubi:10)For more information, see
podman-tag(1)man page on your system.