# Tag Docker Image

> For AI agents: the complete documentation index is at https://buddy.works/llms.txt

Learn how to automatically tag Docker images across different registries and environments.

The **Tag Docker Image** action allows you to automatically tag existing Docker images across different registries or within the same registry. This is especially useful for promoting images between environments (for example, from `staging` to `production`).

![Tag Docker Image action configuration](https://buddy.works/docs/docker/tag-docker-image/tag-docker-image-config.png)

## Configuration

### Image Location

Pick a registry from which the Docker image is to be downloaded.

- **Docker Hub** - most commonly used public Docker registry
- **GitHub Container Registry** - GitHub registry (ghcr.io)
- **Amazon ECR** - Amazon Elastic Container Registry
- **Google Artifact Registry** - Google Cloud Artifact Registry
- **Other** - private registry

### Integration

Select an integration matching the chosen "Image Location", or add a new one with "+".

### Image

Enter the full name of the Docker image to be tagged. 

For example: `your-username/example-image`

### Tag/Version (source)

Specify the existing tag or version of the source image:

For example: `stage`

### Push Image

Select where the tagged image should be pushed:

- **Same location & name** - the same registry with the same name
- **Other** - a different registry or a different name (requires additional configuration).

### Tag/Version (destination)

Enter new tag for the destination image:

For example: `production`

## Variables

You can use Buddy environment variables in the configuration fields, e.g., `$BUDDY_RUN_ID`, `$BUDDY_RUN_TAG`. Check [full list of variables](https://buddy.works/docs/basics/environment-variables/default-variables.md).

> **Tip**
>
> Use [**Docker CLI**](https://buddy.works/docs/actions/docker/docker-cli.md) action if you need more advanced tagging operations.

## YAML i API

- **[YAML configuration](https://buddy.works/docs/yaml/yaml-actions/dockerfile-linter.md)** - Dockerfile linter configuration via YAML
- **[REST API](https://buddy.works/docs/api/actions/add/dockerfile-linter.md)** - adding actions via API


---
Original source: https://buddy.works/docs/actions/docker/tag-docker-image