Retag OCI Images without image pull
This repository has been archived on 2026-09-02. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-20 09:01:32 +01:00
.github/workflows Update python Docker tag to v3.14 2026-07-20 09:01:32 +01:00
container_tagbot Switch to uv 2025-06-22 13:46:12 +01:00
.gitignore Package Updates and Documentation Improvements 2024-11-28 18:30:26 +00:00
.python-version Update python Docker tag to v3.14 2026-07-20 09:01:32 +01:00
LICENSE Switch to uv 2025-06-22 13:46:12 +01:00
pyproject.toml Switch to uv 2025-06-22 13:46:12 +01:00
README.md Package Updates and Documentation Improvements 2024-11-28 18:30:26 +00:00
renovate.json Add renovate.json 2024-11-18 15:46:55 +00:00
uv.lock Switch to uv 2025-06-22 13:46:12 +01:00

Tagbot

Tagbot is a tool for retagging OCI Container Images directly using the registry API, eliminating the need for a full Docker Pull/Push workflow.

Features

  • Add multiple tags to an image without pulling or pushing.
  • Efficient and API-driven.

Usage

Local Usage

To use Tagbot locally, run:

tagbot \
    --username <your-username> \
    --password <your-password> \
    --source <registry>/<image>:<tag> \
    --tags <tag1>,<tag2>

Example:

tagbot \
    --username example \
    --password password \
    --source example.azurecr.io/debian:latest \
    --tags v1.0.0,1.0.0

This command adds the tags v1.0.0 and 1.0.0 to example.azurecr.io/debian:latest. The image can then be pulled using any of the following tags:

  • example.azurecr.io/debian:latest
  • example.azurecr.io/debian:v1.0.0
  • example.azurecr.io/debian:1.0.0

GitHub Actions Usage

name: release

on:
  push:
    tags: ["v[0-9]+.[0-9]+.[0-9]+"]

jobs:
  release:
    uses: cpressland/tagbot/.github/workflows/retag.yaml@master
    with:
      username: example
      source: example.azurecr.io/${{ github.event.repository.name }}:${{ github.ref_name }}
      tags: ${{ matrix.environment }}-v1.0.0,${{ matrix.environment }}
      environment:  ${{ matrix.environment }}
    secrets:
      password: ${{ secrets.ACR_PASSWORD }}
    strategy:
      matrix:
        environment: [staging, production]

FAQ

  • Q: Are registries other than Azure Container Registry supported?
    A: Azure Container Registry is the only officially supported registry. However, other registries, such as Docker Hub, Amazon ECR, and Google Container Registry, are likely to work if they conform to standard OCI APIs.
  • Q: Does Tagbot require admin-level credentials for the registry?
    A: No, it only requires permissions to read and write tags for the specified images.
  • Q: Can I retag multiple images in a single command?
    A: No, Tagbot currently supports retagging one image at a time. Use a script or automation tool to process multiple images.
  • Q: Are there any size limitations for the images being retagged?
    A: No, since Tagbot operates at the registry level, the image size is irrelevant.
  • Q: Is Tagbot secure to use with my credentials?
    A: Tagbot does not store your credentials and only uses them for the duration of the operation. For additional security, use environment variables or secret management tools.
  • Q: Can I remove a tag from an image using Tagbot?
    A: No, Tagbot only supports adding new tags. To remove tags, use your registry's management tools.
  • Q: What happens if the specified tag already exists?
    A: If the tag already exists, Tagbot will reassign it to the source image.
  • Q: Is there a dry-run mode to test without making changes?
    A: Currently, Tagbot does not support a dry-run mode.