Skip to content

imglife sync

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.

FlagDefaultDescription
--dry-runfalseSimulate sync without pushing any images
--listfalsePrint the list of tags that would be synced and exit
Terminal window
# Sync all configured entries
imglife sync
# Preview — show what would be synced
imglife sync --list
# Dry-run — simulate without pushing
imglife sync --dry-run
# With verbose logs
imglife --log-format text --log-level debug sync

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/alpine

For Docker Hub sources (docker.io), imglife fetches tags with their creation dates in a single API call, then:

  1. Filters tags matching tag or tag_regex.
  2. Sorts by semantic version (date-based fallback for non-semver tags).
  3. Retains the keep_last most recent.

For other OCI registries, imglife uses the standard OCI tag listing API and applies the same filter/sort/truncate logic.

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: true
Terminal window
export IMGLIFE_SYNC_PARALLELISM=4 # concurrent syncs (default: 4)

Failed syncs are retried with exponential backoff:

Terminal window
export IMGLIFE_RETRY_ATTEMPTS=3 # default: 3
export IMGLIFE_RETRY_INITIAL_DELAY=2s # default: 2s
export IMGLIFE_RETRY_BACKOFF=2 # default: 2 (multiplier)
export IMGLIFE_RETRY_TIMEOUT=60s # per-operation timeout

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 0

In --dry-run mode the header is prefixed with [dry-run]. Set NO_COLOR=1 or TERM=dumb to disable ANSI colors.

CodeMeaning
0All entries synced successfully
1One or more entries failed