|
| 1 | +--- |
| 2 | +description: Learn about immutable tags and how they help maintain image version consistency on Docker Hub. |
| 3 | +keywords: Docker Hub, Hub, repository content, tags, immutable tags, version control |
| 4 | +title: Immutable tags on Docker Hub |
| 5 | +linkTitle: Immutable tags |
| 6 | +weight: 11 |
| 7 | +--- |
| 8 | +{{< summary-bar feature_name="Immutable tags" >}} |
| 9 | + |
| 10 | +Immutable tags provide a way to ensure that specific image versions remain unchanged once they are published to Docker Hub. This feature helps maintain consistency and reliability in your container deployments by preventing accidental overwrites of important image versions. |
| 11 | + |
| 12 | +## What are immutable tags? |
| 13 | + |
| 14 | +Immutable tags are image tags that, once pushed to Docker Hub, cannot be overwritten or deleted. This ensures that a specific version of an image remains exactly the same throughout its lifecycle, providing: |
| 15 | + |
| 16 | +- Version consistency |
| 17 | +- Reproducible builds |
| 18 | +- Protection against accidental overwrites |
| 19 | +- Better security and compliance |
| 20 | + |
| 21 | +## Enable immutable tags |
| 22 | + |
| 23 | +To enable immutable tags for your repository: |
| 24 | + |
| 25 | +1. Sign in to [Docker Hub](https://hub.docker.com). |
| 26 | +2. Select **My Hub** > **Repositories**. |
| 27 | +3. Select the repository where you want to enable immutable tags. |
| 28 | +4. Select the **Settings** tab |
| 29 | +5. Under **Tag mutability settings**, select **Immutable**. |
| 30 | +6. Select **Save**. |
| 31 | + |
| 32 | +Once enabled, all tags are locked to their specific images, ensuring that each tag always points to the same image version and cannot be modified. |
| 33 | + |
| 34 | + > [!NOTE] |
| 35 | +> |
| 36 | +> All tags in the repository become immutable, including the `latest` tag. |
| 37 | +
|
| 38 | +## Working with immutable tags |
| 39 | + |
| 40 | +When immutable tags are enabled: |
| 41 | + |
| 42 | +- You cannot push a new image with the same tag name |
| 43 | +- You must use a new tag name for each new image version |
| 44 | + |
| 45 | +To push an image, create a new tag for your updated image and push it to the repository. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
0 commit comments