# docker tag Command Reference

> Reference for docker tag in CI: add a new name and tag to an existing image so it can be pushed to a registry under multiple references.

Source: https://latchkey.dev/learn/command-reference/docker-tag-command-reference  
Updated: 2026-06-26

Create an additional name reference for an existing image.

docker tag creates a new tag (a pointer) to an existing image ID. It copies nothing; the same image now answers to multiple names. This is how you prepare a locally built image for push to a registry namespace.

## Usage

- `docker tag SOURCE[:TAG] TARGET[:TAG]` - point TARGET at the SOURCE image
- TARGET should include the registry host for non-Docker-Hub registries
- No flags; both arguments are image references

## Example

```shell
docker build -t app:build .
docker tag app:build ghcr.io/myorg/app:${{ github.sha }}
docker tag app:build ghcr.io/myorg/app:latest
```

## In CI

Build once with a local name, then tag the same image with each registry reference you intend to push (a SHA tag and latest). Because tags are just pointers, this is free and keeps the SHA and latest images byte-identical.

## FAQ

### docker tag Command Reference?

docker tag creates a new tag (a pointer) to an existing image ID. It copies nothing; the same image now answers to multiple names. This is how you prepare a locally built image for push to a registry namespace.

### In CI?

Build once with a local name, then tag the same image with each registry reference you intend to push (a SHA tag and latest). Because tags are just pointers, this is free and keeps the SHA and latest images byte-identical.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
