Implementation:Apache Airflow Retag Docker Images
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Release_Engineering, Container_Registry |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Concrete tools for publishing release artifacts provided by retag_docker_images.py and prune_old_dirs.py.
Description
The retag_docker_images.py script uses regctl to re-tag Docker images from RC versions to final release versions on GHCR without pulling/pushing layers. The prune_old_dirs.py script removes old release directories from SVN to maintain a clean distribution archive.
Usage
Run after community vote approval to re-tag images and clean up old releases.
Code Reference
Source Location
- Repository: Apache Airflow
- File: dev/retag_docker_images.py (L1-87)
- File: dev/prune_old_dirs.py (L1-102)
Signature
PYTHON_VERSIONS = ["3.10", "3.11", "3.12"]
GHCR_IO_PREFIX = "ghcr.io"
def pull_push_all_images(
source_prefix: str,
target_prefix: str,
images: list[str],
source_branch: str,
source_repo: str,
target_branch: str,
target_repo: str,
) -> None:
"""Re-tag images from source to target via regctl."""
...
Import
# Re-tag Docker images
python dev/retag_docker_images.py \
--source-branch 3.1.0rc1 \
--target-branch 3.1.0
# Prune old SVN directories
python dev/prune_old_dirs.py --path /path/to/svn/dist --execute
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| source_branch | str | Yes | RC tag (e.g., 3.1.0rc1) |
| target_branch | str | Yes | Release tag (e.g., 3.1.0) |
| source_repo | str | No | Source container repository |
| target_repo | str | No | Target container repository |
Outputs
| Name | Type | Description |
|---|---|---|
| Re-tagged images | GHCR | Docker images with release version tags |
| Pruned directories | SVN | Old versions removed from dist |
Usage Examples
Publish Release
# 1. Re-tag Docker images from RC to release
python dev/retag_docker_images.py \
--source-branch 3.1.0rc1 \
--target-branch 3.1.0
# 2. Upload to PyPI
twine upload dist/apache_airflow-3.1.0.tar.gz
# 3. Clean up old versions
python dev/prune_old_dirs.py --path svn/dist/airflow --execute
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment