Skip to main content

Retags a Container in a Container Registry without the need for Docker

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

container_tagbot-3.2.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

container_tagbot-3.2.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file container_tagbot-3.2.0.tar.gz.

File metadata

  • Download URL: container_tagbot-3.2.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.5.0-1025-azure

File hashes

Hashes for container_tagbot-3.2.0.tar.gz
Algorithm Hash digest
SHA256 909183897d6854c3e20dd1581e027617204ea82243d9841b31d7acf7b186ceb4
MD5 fdb232b2d9cfec4f189969d15afd1e2d
BLAKE2b-256 f25946170d2887de2087872cc4511aec5d25a0f17c47c85460b954ff24c1a88e

See more details on using hashes here.

File details

Details for the file container_tagbot-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: container_tagbot-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.5.0-1025-azure

File hashes

Hashes for container_tagbot-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7c4ecb945d4ea37195a355a4da51ccd7c177abfda099260f198c7aafb377f8f
MD5 e8ad9b67f43520043a15f3c44e8b462a
BLAKE2b-256 2904a10b162d219758cc8ef7a7ff2ba311338441c3694efe22476b3f72734e9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page