From e73b23c2de743579431588ca86d4f7ae2e829257 Mon Sep 17 00:00:00 2001 From: Lucian Buzzo Date: Wed, 5 May 2021 15:49:32 +0100 Subject: [PATCH] Add documentation for cache usage This change adds simple documentation for the cache functionality added in https://github.com/deislabs/oras/pull/203 --- docs/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/index.md b/docs/index.md index 4e3a2fac..87616837 100644 --- a/docs/index.md +++ b/docs/index.md @@ -229,6 +229,19 @@ Pulling artifacts involves specifying the content addressable artifact, along wi oras pull localhost:5000/hello-artifact:v2 -a ``` +### Using cache when pulling artifacts + +In order to save unnecessary network bandwidth and disk I/O oras should provides a solution to pull the artifacts into a local content-address storage (CAS) if the content does not exist, and then copy the artifact to the desired storage. + +The cache directory is specified by using the environment variable `ORAS_CACHE`. If not specified, cache is not used. + +```sh +# Set cache root +export ORAS_CACHE=~/.oras/cache +# Pull artifacts as usual +oras pull localhost:5000/hello:latest +``` + ## ORAS Go Module While the ORAS CLI provides a great way to get started, and test registry support for [OCI Artifacts][artifacts], the primary experience enables a native experience for your artifact of choice. Using the ORAS Go Module, you can develop your own push/pull experience: `myclient push artifacts.azurecr.io/myartifact:1.0 ./mything.thang`