Sign inSign up

oidatiftla/docker-tag-enhancer

By oidatiftla

โ€ขUpdated 3 days ago

Add major and major.minor tags to docker images that have only major.minor.patch as tags available.

Image
0

10K+

oidatiftla/docker-tag-enhancer repository overview

โ docker-tag-enhancer

Test, Build and Deploy

Add major and major.minor tags to docker images that have only major.minor.patch as tags available.

โ Features

  • ๐Ÿท๏ธ Automatically generates major and major.minor tags from existing major.minor.patch tags
  • ๐Ÿณ Multi-architecture support
  • ๐Ÿ” Flexible filtering with regex, prefix, and suffix support
  • โšก Digest-based optimization (skips copying when images are identical)
  • ๐Ÿงช Comprehensive test suite
  • ๐Ÿš€ Automated CI/CD pipeline with GitHub Actions

โ Usage

โ Login
docker run --rm -it -v ~/.docker/config.json:/root/.docker/config.json oidatiftla/docker-tag-enhancer --login --registry registry.example.com
โ With filter
docker run --rm -it -v ~/.docker/config.json:/root/.docker/config.json oidatiftla/docker-tag-enhancer -s registry.example.com/name1 -d registry.example.com/name2 -f '^((?!-rc|^8\.|^9\.|^10\.|^11\.|^12\.).)*$'
โ With leading-zero version components (e.g. zero-padded timestamps)

By default, version components must not have leading zeros (0, 1, 2, ... 9, 10, ... but not 01). Use --allow-leading-zeros if your tags contain zero-padded numbers, e.g. 0.2609.0611.1310.

docker run --rm -it -v ~/.docker/config.json:/root/.docker/config.json oidatiftla/docker-tag-enhancer -s registry.example.com/name1 -d registry.example.com/name2 --allow-leading-zeros
โ GitHub Container Registry (GHCR) read existing tags

For some reason (sourceโ , sourceโ ) the GITHUB_TOKEN needs to be encoded with base64:

...

permissions:
  contents: read
  packages: write

...

jobs:
  job:
    runs-on: ubuntu-latest
    steps:

...

      - name: Retrieve tags
        run: |
          ENCODED=$(echo -n "${{ secrets.GITHUB_TOKEN }}" | base64)

          skopeo list-tags \
            --registry-token="${ENCODED}" \
            docker://${DOCKER_REGISTRY_IMAGE}

โ Build from source

docker buildx create --name mybuilder --use --bootstrap
docker buildx build --push --platform linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 --pull -t oidatiftla/docker-tag-enhancer .

Tag summary

Content type

Image

Digest

sha256:b6d33920fโ€ฆ

Size

115.1 MB

Last updated

3 days ago

docker pull oidatiftla/docker-tag-enhancer