Skip to content

Guide

Run your own mirror of the catalog with oic-sync

Keep a copy of the signed images on your own server or object storage, for clouds that should not, or cannot, download from images.openimages.cloud. Point oic-sync, Glance, Proxmox VE and people at it instead of the CDN.

What it does

oic-sync mirror copies the images you pick (qcow2, cosign bundles, checksums, manifests) in the layout of the CDN, with an index.json whose URLs point to your mirror. The mirror is a drop-in replacement for https://images.openimages.cloud.

  • Every file is verified before it lands: size, sha256, sha512 and the cosign signature.
  • Run it again at any time: it only downloads what changed, and resumes interrupted downloads.
  • Signatures are copied untouched, so clients verify the mirror exactly as they verify the CDN.
  • A directory served by any web server, or an S3 bucket that serves itself.

Install

From PyPI, or the Debian and RPM packages and the container image of each release (both extras included). Python 3.10 or newer.

pipx
pipx install oic-sync
# S3 bucket destination: add the s3 extra (boto3)
pipx install 'oic-sync[s3]'

First run

--base-url is the URL the directory will be served at. Start with --dry-run.

bash
# What would be downloaded (signatures verified, nothing written)
oic-sync mirror --dest /srv/oic-mirror --base-url https://mirror.example.net/oic \
  --image debian-13 --image ubuntu-24.04 --dry-run
# Do it
oic-sync mirror --dest /srv/oic-mirror --base-url https://mirror.example.net/oic \
  --image debian-13 --image ubuntu-24.04
# Every image except the service ones, two versions each, delete what falls out of --keep
oic-sync mirror --dest /srv/oic-mirror --base-url https://mirror.example.net/oic \
  --keep 2 --prune

The result, for one image:

layout
/srv/oic-mirror/
  index.json                 URLs rewritten to --base-url, mirrored images only
  debian-13/
    latest.json
    versions.json            the mirrored versions only
    13-20261111-2659/
      debian-13-20261111-2659-x86_64.qcow2
      debian-13-20261111-2659-x86_64.qcow2.bundle   cosign bundle, untouched
      debian-13-20261111-2659-x86_64.qcow2.sha256
      MANIFEST.json  SHA256SUMS  index.html

Then, anywhere that reaches the mirror:

bash
export OIC_INDEX_URL=https://mirror.example.net/oic/index.json
oic-sync verify --image debian-13
oic-sync openstack sync --cloud mycloud --image debian-13
oic-sync proxmox sync --image debian-13 --vmid-base 9000

Serve it

Any web server will do. With nginx, hiding the temporary and lock files:

nginx
server {
    listen 443 ssl;
    server_name mirror.example.net;
    # ssl_certificate ...;
    location ~ /\. { deny all; }   # .part files and the lock
    location /oic/ {
        alias /srv/oic-mirror/;
    }
}

The full reference, with a Caddy example, is in the README.

In an S3 bucket

With --dest s3://bucket/prefix, the mirror lives in AWS S3 or any S3-compatible object storage (Ceph RGW, MinIO, Swift with s3api, Infomaniak, OVHcloud...), and the bucket serves it: no web server to run.

S3
export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...   # or a profile in ~/.aws
oic-sync mirror --dest s3://images/oic --s3-endpoint-url https://s3.example.net \
  --base-url https://s3.example.net/images/oic --keep 2 --prune
  • Credentials, region and endpoint come from the usual AWS settings (environment, ~/.aws/config, instance role).
  • Each qcow2 is downloaded and verified in a local staging directory, then uploaded: the bucket never holds an unverified image. Plan local space for the largest image (2 GiB).
  • Objects get the cache headers of the CDN and carry their digests as metadata, so later runs do not download images back to check them.
  • The bucket needs public read on the prefix (or read for your clients): oic-sync does not change bucket policies.

Options

Options of oic-sync mirror. The full list is in oic-sync mirror --help.

OptionMeaning
--dest DESTMirror directory (created if needed), or s3://bucket/prefix.
--base-url URLURL the mirror is served at; written into the mirror index.json.
--keep NVersions per image, the latest included (default 1).
--pruneDelete versions beyond --keep, only when the kept ones are complete.
--dry-runVerify signatures and existing files, show what would change, write nothing.
--image IDImage to mirror, repeatable. Default: every image except the service and test images.
--variant NAMEOnly this variant of multi-variant images.
--s3-endpoint-url URLS3 only: endpoint of a non-AWS object storage.
--staging-dir DIRS3 only: where each qcow2 is downloaded and verified before upload.
--eol warn|skip|failWhat to do with images whose release reached its end of life.
--index-url URLAnother index ($OIC_INDEX_URL): a mirror can itself be mirrored.

How the copy stays safe

  1. Verify the cosign bundle of each qcow2 against the sha256 of the index, with the signer identity built into oic-sync, before anything is downloaded.
  2. Download to a hidden temporary file, then check its size, sha256 and sha512. A mismatch deletes it and fails the image.
  3. Move it into place (or upload it to the bucket).
  4. Publish index.json, versions.json and latest.json last: an image whose new version fails keeps its previous entry, so the mirror never announces an incomplete version.

A lock stops two runs on the same mirror. Clients check signatures against the signer built into oic-sync, not against the one the mirror index announces: a tampered mirror cannot vouch for foreign images.

Run it daily

The catalog is rebuilt once a day. As a user that owns the directory:

systemd service
# /etc/systemd/system/oic-sync-mirror.service
[Service]
Type=oneshot
User=oic-mirror
ExecStart=/usr/local/bin/oic-sync mirror --dest /srv/oic-mirror \
  --base-url https://mirror.example.net/oic --keep 2 --prune
systemd timer
# /etc/systemd/system/oic-sync-mirror.timer
[Timer]
OnCalendar=daily
RandomizedDelaySec=1h
Persistent=true

[Install]
WantedBy=timers.target
bash
systemctl enable --now oic-sync-mirror.timer

Limitations

  • The mirror host needs the CDN and the Sigstore trust root (tuf-repo-cdn.sigstore.dev). Clients that verify signatures need the trust root too, or --no-verify-signature; they still check the sha256 of every import.
  • Plain http:// base URLs are accepted for internal mirrors: integrity rests on the signed digests. HTTPS is still better, as someone on the path could serve an older signed version.
  • To drop an image, delete its directory (or its prefix in the bucket): the next run removes it from index.json.