Images from your registry

Hangar can run a public container image straight from Docker Hub, GitHub Container Registry, NVIDIA NGC, Amazon ECR Public or Quay, so you do not need Docker on your machine. You pay for the jobs of the image.

Give the image as REGISTRY/NAME@sha256:DIGEST. Hangar fetches the image into Sydney once, checks every byte against the digest, and stores the image under your organisation's key. Hangar then checks the image as Hangar checks a pushed image. The worker takes the image from Sydney only.

$ hangar upload --image docker.io/library/python@sha256:5c0e9a17d2b4a1f0c3e5d7b9a2c4e6f8a0b1c3d5e7f9a2b4c6d8e0f1a3b5c7d9
Ctrl C stops this wait. The fetch continues in Sydney, and the same command follows it again.
Fetching docker.io/library/python@sha256:5c0e9a17d2b4 into Sydney: 3 of 7 layers, 0.4 of 1.1 GB.
Fetched docker.io/library/python@sha256:5c0e9a17d2b4 into Sydney: 7 layers, 1.1 GB.
Registered a one-time pull of docker.io/library/python@sha256:5c0e9a17d2b4a1f0c3e5d7b9a2c4e6f8a0b1c3d5e7f9a2b4c6d8e0f1a3b5c7d9.
Preflight passed: linux/amd64 (GPU pools), linux/arm64 (CPU sandbox), entrypoint python3.

The registries

Hangar fetches public images from these registries:

RegistryA reference starts with
Docker Hubdocker.io/ (a name with no registry, such as python@sha256:..., is Docker Hub's library/python)
GitHub Container Registryghcr.io/
NVIDIA NGCnvcr.io/
Amazon ECR Publicpublic.ecr.aws/
Quayquay.io/

To use an image from another registry, or a private image, push the image from an OCI archive with hangar upload --image ARCHIVE --name NAME:TAG (Bring your image).

By digest

Hangar fetches by digest, because a tag can point to other bytes tomorrow. A digest means that what runs is what you approved. Hangar reads a tag beside the digest (python:3.12@sha256:...) and sets the tag aside. Hangar refuses a reference with a tag and no digest, with image_pull_digest_required. The digest is on the image's tag page on the registry, and crane digest REFERENCE prints the digest on any computer.

What Hangar fetches

Each kept part is an object of your organisation, with a received movement record, as a pushed layer is.

Limits

Following a fetch

POST /v1/images/pull answers at once. The image is pending, status is fetching, and fetch shows the progress. GET /v1/images shows the same fetch on the image:

When the bytes are in Sydney, the image changes to passed or failed. The reason is in preflight_error, in three parts. Hangar answers a job of an image that is still fetching with image_preflight_pending.

Ctrl C ends the CLI's wait, and the fetch continues. Run the same command again to follow the fetch. When Sydney already stores the digest, Hangar checks the image at once.

When a fetch fails

CodeWhat it means
image_fetch_not_foundThe registry has no public image with that digest.
image_fetch_unreachableThe registry did not answer after five attempts.
image_fetch_digest_mismatchThe registry sent a part that does not match its digest.
image_fetch_redirect_refusedThe registry sent Hangar to a download address outside the registry's list.
image_registry_not_allowedThe reference points to a registry that is not in the table above.

Each answer shows the next step and a second step. If you register the same reference again, Hangar starts a new fetch and keeps every layer that the last fetch fetched.

Read this page as Markdown