imglife sync
Synopsis
Section titled “Synopsis”imglife sync [flags]Copies upstream images listed in sync.entries to your private OCI registry. For Docker Hub sources, tag resolution uses the Docker Hub API (dates + tag list in a single call). For other registries, standard OCI tag listing is used.
| Flag | Default | Description |
|---|---|---|
--dry-run | false | Simulate sync without pushing any images |
--list | false | Print the list of tags that would be synced and exit |
Examples
Section titled “Examples”# Sync all configured entriesimglife sync
# Preview — show what would be syncedimglife sync --list
# Dry-run — simulate without pushingimglife sync --dry-run
# With verbose logsimglife --log-format text --log-level debug syncConfiguration
Section titled “Configuration”Sync behaviour is controlled by sync.entries in imglife.yaml. See the sync configuration reference.
Minimal example:
sync: entries: - source: docker.io/library/alpine tag_regex: '^3\.\d+\.\d+$' keep_last: 3 target: registry.example.com/mirrors/alpineHow tag resolution works
Section titled “How tag resolution works”For Docker Hub sources (docker.io), imglife fetches tags with their creation dates in a single API call, then:
- Filters tags matching
tagortag_regex. - Sorts by semantic version (date-based fallback for non-semver tags).
- Retains the
keep_lastmost recent.
For other OCI registries, imglife uses the standard OCI tag listing API and applies the same filter/sort/truncate logic.
Digest re-sync
Section titled “Digest re-sync”By default, imglife skips a tag if it already exists in the target. Set check_digest: true on an entry to re-sync when the upstream digest has changed:
- source: docker.io/library/alpine tag: latest target: registry.example.com/mirrors/alpine check_digest: trueParallelism
Section titled “Parallelism”export IMGLIFE_SYNC_PARALLELISM=4 # concurrent syncs (default: 4)Retry behaviour
Section titled “Retry behaviour”Failed syncs are retried with exponential backoff:
export IMGLIFE_RETRY_ATTEMPTS=3 # default: 3export IMGLIFE_RETRY_INITIAL_DELAY=2s # default: 2sexport IMGLIFE_RETRY_BACKOFF=2 # default: 2 (multiplier)export IMGLIFE_RETRY_TIMEOUT=60s # per-operation timeoutSummary report
Section titled “Summary report”After each run (not in --list mode), imglife prints a summary to stdout:
Sync Summary · 4.2s ─────────────────────────────────── Mirror images managed 12 ├─ Synced 8 ├─ Up-to-date 4 └─ Errors 0In --dry-run mode the header is prefixed with [dry-run]. Set NO_COLOR=1 or TERM=dumb to disable ANSI colors.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | All entries synced successfully |
1 | One or more entries failed |