Skip to content

Instantly share code, notes, and snippets.

@renfei
Created April 23, 2024 02:03
Show Gist options
  • Select an option

  • Save renfei/57eaea351657c0a476a7997a2f761d4c to your computer and use it in GitHub Desktop.

Select an option

Save renfei/57eaea351657c0a476a7997a2f761d4c to your computer and use it in GitHub Desktop.
Fetch from OCI registry (ghcr.io)
#!/bin/sh
# Get Token
curl -u renfei:{password} https://ghcr.io/token\?scope\=repository:renfei/renfeid:pull
# Get manifests
curl "https://ghcr.io/v2/renfei/renfeid/manifests/latest" -H "Authorization: Bearer {TOKEN}"
# Get blobs
curl https://ghcr.io/v2/renfei/renfeid/blobs/sha256:0f3320e4e2ae41973a279c466eba6f7af49750691a7d55baabde5b47c635660f -H "Authorization: Bearer {TOKEN}" -v
# 307 redirect to
https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:643e7d1b70050a8ce798dd3e13997617b1e1bfa20ea27e091160fa08b3f867d3?se=2024-04-23T02%3A00%3A00Z&sig=2ti4Gs7Ybo%2B47XCnVuwoKvlLGLV1U%2B1i1ZWilf3Uank%3D&sp=r&spr=https&sr=b&sv=2019-12-12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment