Skip to main content

oras blob fetch

Fetch a blob from a remote registry.

oras blob fetch [flags] {--output <file> | --descriptor} <name>@<digest>

Examples

Fetch a blob from registry and save it to a local file:

oras blob fetch --output blob.tar.gz localhost:5000/hello@sha256:9a201d228ebd966211f7d1131be19f152be428bd373a92071c71d8deaf83b3e5

Fetch a blob from registry and print the raw blob content:

oras blob fetch --output - localhost:5000/hello@sha256:9a201d228ebd966211f7d1131be19f152be428bd373a92071c71d8deaf83b3e5

Fetch and print the descriptor of a blob:

oras blob fetch --descriptor localhost:5000/hello@sha256:9a201d228ebd966211f7d1131be19f152be428bd373a92071c71d8deaf83b3e5

Fetch a blob, save it to a local file and print the descriptor:

oras blob fetch --output blob.tar.gz --descriptor localhost:5000/hello@sha256:9a201d228ebd966211f7d1131be19f152be428bd373a92071c71d8deaf83b3e5

Fetch and print a blob from OCI image layout folder 'layout-dir':

oras blob fetch --oci-layout --output - layout-dir@sha256:9a201d228ebd966211f7d1131be19f152be428bd373a92071c71d8deaf83b3e5

Fetch and print a blob from OCI image layout archive file 'layout.tar':

oras blob fetch --oci-layout --output - layout.tar@sha256:9a201d228ebd966211f7d1131be19f152be428bd373a92071c71d8deaf83b3e5

Fetch a blob with a specific reference, determine its size using jq, and use pv to display the progress while redirecting the output to a file named layer.bin:

 $blob_ref=ghcr.io/oras-project/oras@sha256:74529e03eae02d1fff5c05e9a6ec2089e1f5ae96421169c29a7c165346e042e4
$size=$(oras blob fetch --descriptor $blob_ref | jq -r .size)
$oras blob fetch $blob_ref --output - | pv -s $size > layer.bin

Options

      --ca-file string                             server certificate authority file for the remote registry
-d, --debug debug mode
--descriptor output the descriptor
-H, --header stringArray add custom headers to requests
-h, --help help for fetch
--insecure allow connections to SSL registry without certs
--oci-layout set target as an OCI image layout
-o, --output path output file path, use - for stdout
-p, --password string registry password or identity token
--password-stdin read password or identity token from stdin
--plain-http allow insecure connections to registry without SSL check
--pretty prettify JSON objects printed to stdout
--registry-config path path of the authentication file for registry
--resolve host:port:address[:address_port] customized DNS for registry, formatted in host:port:address[:address_port]
-u, --username string registry username
-v, --verbose verbose output