A CLI tool to mirror helm charts and docker images from public registries to local/private repositories.
Project description
xrepomirror
A CLI tool to mirror Docker images and Helm charts from public registries to local/private repositories. Designed for air-gapped or restricted environments where workloads cannot pull directly from the internet.
Features
- Mirror Docker images via
docker pull/docker tag/docker push - Mirror Helm charts via
helm pull/helm push(OCI) or Nexus 3 REST API upload - Proxy support via configurable environment variables
- Single
sources.yamlconfiguration file for all sources and destinations - Supports Python 3.6 and above
Requirements
- Python 3.6+
dockerCLI — available and authenticated to the destination registryhelmCLI (v3) — available and authenticated to the destination registry (for Helm mirroring)
Installation
pip install xrepomirror
Or install from source:
git clone https://github.com/tkdpython/xrepomirror.git
cd xrepomirror
pip install .
Configuration
Create a sources.yaml file in your working directory. The file has two top-level keys: sources and settings.
Full example
sources:
docker_images:
- source: docker.io/grafana/grafana:12.3.0
- source: ghcr.io/grafana/grafana-operator:v5.21.3
- source: quay.io/prometheus/prometheus:v3.9.1
helm_charts:
- chart: kube-prometheus-stack
repo: https://prometheus-community.github.io/helm-charts
version: 80.13.3
- chart: grafana-operator
repo: https://grafana.github.io/helm-charts
version: 5.21.4
settings:
destination_repositories:
docker:
repo: ctr.example.com
helm:
repo: repo.example.com/helm
type: nexus3 # "nexus3" or "oci" (default: "oci")
env_vars:
HTTP_PROXY: http://proxy.local:8080
HTTPS_PROXY: http://proxy.local:8080
NO_PROXY: .mycompany.co.uk,.svc,.local,localhost
sources
| Key | Description |
|---|---|
docker_images |
List of Docker image references to mirror. Each entry requires a source key with the full image reference including tag. |
helm_charts |
List of Helm charts to mirror. Each entry requires chart (chart name), repo (upstream Helm repo URL), and version. |
settings
| Key | Description |
|---|---|
destination_repositories.docker.repo |
Destination Docker registry host/prefix (e.g. ctr.example.com). |
destination_repositories.helm.repo |
Destination Helm repository. For OCI this is the registry path; for Nexus 3 this is <host>/<repo-name>. |
destination_repositories.helm.type |
How to upload Helm charts — "oci" (default, uses helm push) or "nexus3" (uses the Nexus 3 REST API). |
env_vars |
Key/value pairs to set as environment variables before any operations. Existing variables are not overwritten, so values can be overridden at runtime. |
Usage
xrepomirror [--sources FILE] [--skip-docker] [--skip-helm]
| Flag | Description |
|---|---|
--sources FILE |
Path to the sources YAML file (default: sources.yaml in the current directory). |
--skip-docker |
Skip mirroring Docker images. |
--skip-helm |
Skip mirroring Helm charts. |
--version |
Print the version and exit. |
Examples
Mirror everything using the default sources.yaml:
xrepomirror
Mirror only Helm charts:
xrepomirror --skip-docker
Mirror only Docker images using a custom config file:
xrepomirror --sources /path/to/my-sources.yaml --skip-helm
Docker image destination naming
The destination image reference is derived from the source by taking the last path segment (image name and tag) and prefixing it with the configured destination registry. For example:
| Source | Destination (ctr.example.com) |
|---|---|
docker.io/grafana/grafana:12.3.0 |
ctr.example.com/grafana:12.3.0 |
ghcr.io/grafana/grafana-operator:v5.21.3 |
ctr.example.com/grafana-operator:v5.21.3 |
quay.io/prometheus/prometheus:v3.9.1 |
ctr.example.com/prometheus:v3.9.1 |
Helm destination types
OCI (default)
Charts are pushed using helm push to an OCI-compatible registry:
settings:
destination_repositories:
helm:
repo: ctr.example.com/helm-charts
type: oci
Nexus 3
Charts are uploaded via the Nexus 3 REST API (POST /service/rest/v1/components). The repo value must be in the format <host>/<repository-name>:
settings:
destination_repositories:
helm:
repo: repo.example.com/helm
type: nexus3
Proxy support
Set env_vars in sources.yaml to inject proxy settings before any network operations. Standard proxy variables are supported: HTTP_PROXY, HTTPS_PROXY, NO_PROXY (and their lowercase equivalents). Variables that are already set in the shell environment take precedence over values in sources.yaml.
Dependencies
| Package | Purpose |
|---|---|
PyYAML>=5.1 |
Parsing sources.yaml |
requests>=2.20.0 |
Nexus 3 REST API uploads |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xrepomirror-0.1.0.tar.gz.
File metadata
- Download URL: xrepomirror-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79e6342828ef66c8c778a2ace47e0a6f84788fac545dd69da4a5ba698f80e45c
|
|
| MD5 |
4d176443e8391a402adfc83da19aab90
|
|
| BLAKE2b-256 |
bbccba7cf9f711c1be5c8015de8eaef13837142df462fa58a8f62504ddb7e72c
|
Provenance
The following attestation bundles were made for xrepomirror-0.1.0.tar.gz:
Publisher:
publish.yml on tkdpython/xrepomirror
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrepomirror-0.1.0.tar.gz -
Subject digest:
79e6342828ef66c8c778a2ace47e0a6f84788fac545dd69da4a5ba698f80e45c - Sigstore transparency entry: 1271912571
- Sigstore integration time:
-
Permalink:
tkdpython/xrepomirror@6c642d46c86d26a9758095ec2c1b4de76b6f5aa5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tkdpython
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c642d46c86d26a9758095ec2c1b4de76b6f5aa5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file xrepomirror-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xrepomirror-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
545f1264a5d083bfa4a0253e916d313a7b476781b58415781abb68f6b0c2d026
|
|
| MD5 |
f250da93f873ceead52abeed25fbfe3b
|
|
| BLAKE2b-256 |
3300a8a5725f59af8bf06a53e7bed9fe8b6e4fd2ded892a011d3d80bfe65cfff
|
Provenance
The following attestation bundles were made for xrepomirror-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on tkdpython/xrepomirror
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrepomirror-0.1.0-py3-none-any.whl -
Subject digest:
545f1264a5d083bfa4a0253e916d313a7b476781b58415781abb68f6b0c2d026 - Sigstore transparency entry: 1271912596
- Sigstore integration time:
-
Permalink:
tkdpython/xrepomirror@6c642d46c86d26a9758095ec2c1b4de76b6f5aa5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tkdpython
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6c642d46c86d26a9758095ec2c1b4de76b6f5aa5 -
Trigger Event:
push
-
Statement type: