podman tag: Add Names to an Image
podman tag adds another name or tag to an existing local image without copying any data.
Before pushing, you usually tag the freshly built image with its full registry reference. podman tag matches docker tag exactly.
What it does
podman tag creates an additional reference (name:tag) pointing at the same image ID. No layers are copied; it is a cheap pointer, used to give a local image its registry-qualified name ahead of a push.
Common usage
podman tag myapp:latest ghcr.io/owner/app:1.2.3
podman tag myapp:latest ghcr.io/owner/app:latest
# tag by image ID
podman tag 9c1b6dd ghcr.io/owner/app:sha-$GITHUB_SHAOptions
| Argument | What it does |
|---|---|
| <source> | Existing image name:tag or image ID |
| <target> | New reference, e.g. registry/owner/app:tag |
In CI
Tag the build output with both an immutable tag (the commit SHA) and a moving tag (latest), then push both. A registry-qualified target name lets podman push send it without a second destination argument.
Common errors in CI
"Error: <name>: image not known" means the source name or ID does not exist locally; check podman images for the exact reference. "invalid reference format" means a malformed target, often an uppercase letter in the repository path or a missing tag after a registry that requires one.