You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-registry/container-registry-oci-artifacts.md
+51-16Lines changed: 51 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,25 +17,15 @@ To demonstrate this capability, this article shows how to use the [OCI Registry
17
17
## Prerequisites
18
18
19
19
***Azure container registry** - Create a container registry in your Azure subscription. For example, use the [Azure portal](container-registry-get-started-portal.md) or the [Azure CLI](container-registry-get-started-azure-cli.md).
20
-
***ORAS tool** - Download and install a current ORAS release for your operating system from the [GitHub repo](https://github.com/deislabs/oras/releases). The tool is released as a compressed tarball (`.tar.gz` file). Extract and install the file using standard procedures for your operating system.
20
+
***ORAS tool** - Download and install ORAS CLI v0.16.0 for your operating system from the [ORAS installation guide](https://oras.land/cli/).
21
21
***Azure Active Directory service principal (optional)** - To authenticate directly with ORAS, create a [service principal](container-registry-auth-service-principal.md) to access your registry. Ensure that the service principal is assigned a role such as AcrPush so that it has permissions to push and pull artifacts.
22
22
***Azure CLI (optional)** - To use an individual identity, you need a local installation of the Azure CLI. Version 2.0.71 or later is recommended. Run `az --version `to find the version. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
23
23
***Docker (optional)** - To use an individual identity, you must also have Docker installed locally, to authenticate with the registry. Docker provides packages that easily configure Docker on any [macOS][docker-mac], [Windows][docker-windows], or [Linux][docker-linux] system.
24
24
25
25
26
26
## Sign in to a registry
27
27
28
-
This section shows two suggested workflows to sign into the registry, depending on the identity used. Choose the method appropriate for your environment.
29
-
30
-
### Sign in with ORAS
31
-
32
-
Using a [service principal](container-registry-auth-service-principal.md) with push rights, run the `oras login` command to sign in to the registry using the service principal application ID and password. Specify the fully qualified registry name (all lowercase), in this case *myregistry.azurecr.io*. The service principal application ID is passed in the environment variable `$SP_APP_ID`, and the password in the variable `$SP_PASSWD`.
To read the password from Stdin, use `--password-stdin`.
28
+
This section shows two suggested workflows to sign into the registry, depending on the identity used. Choose the one of the two methods below appropriate for your environment.
39
29
40
30
### Sign in with Azure CLI
41
31
@@ -51,6 +41,52 @@ az acr login --name myregistry
51
41
> [!NOTE]
52
42
> `az acr login` uses the Docker client to set an Azure Active Directory token in the `docker.config` file. The Docker client must be installed and running to complete the individual authentication flow.
53
43
44
+
### Sign in with ORAS
45
+
46
+
This section shows options to sign into the registry. Choose one method below appropriate for your environment.
47
+
48
+
Run `oras login` to authenticate with the registry. You may pass [registry credentials](container-registry-authentication.md) appropriate for your scenario, such as service principal credentials, user identity, or a repository-scoped token (preview).
49
+
50
+
- Authenticate with your [individual Azure AD identity](container-registry-authentication.md?tabs=azure-cli#individual-login-with-azure-ad) to use an AD token. Always use "000..." as the token is parsed through the `PASSWORD` variable.
- Authenticate with a [repository scoped token](container-registry-repository-scoped-permissions.md) (Preview) to use non-AD based tokens.
58
+
59
+
```azurecli
60
+
USER_NAME="oras-token"
61
+
PASSWORD=$(az acr token create -n $USER_NAME \
62
+
-r $ACR_NAME \
63
+
--repository $REPO content/write \
64
+
--only-show-errors \
65
+
--query "credentials.passwords[0].value" -o tsv)
66
+
```
67
+
68
+
- Authenticate with an Azure Active Directory [service principal with pull and push permissions](container-registry-auth-service-principal.md#create-a-service-principal) (AcrPush role) to the registry.
69
+
70
+
```azurecli
71
+
SERVICE_PRINCIPAL_NAME="oras-sp"
72
+
ACR_REGISTRY_ID=$(az acr show --name $ACR_NAME --query id --output tsv)
73
+
PASSWORD=$(az ad sp create-for-rbac --name $SERVICE_PRINCIPAL_NAME \
74
+
--scopes $(az acr show --name $ACR_NAME --query id --output tsv) \
75
+
--role acrpush \
76
+
--query "password" --output tsv)
77
+
USER_NAME=$(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME --query "[].appId" --output tsv)
78
+
```
79
+
80
+
Supply the credentials to `oras login` after authentication configured.
81
+
82
+
```bash
83
+
oras login $REGISTRY \
84
+
--username $USER_NAME \
85
+
--password $PASSWORD
86
+
```
87
+
88
+
To read the password from Stdin, use `--password-stdin`.
89
+
54
90
## Push an artifact
55
91
56
92
Create a text file in a local working working directory with some sample text. For example, in a bash shell:
@@ -65,15 +101,15 @@ Use the `oras push` command to push this text file to your registry. The followi
# Push and pull supply chain artifacts using Azure Registry (Preview)
13
13
14
-
Use an Azure container registry to store and manage a graph of artifacts, including signatures, software bill of materials (SBoM), security scan results or other types.
14
+
Use an Azure container registry to store and manage a graph of supply chain artifacts along side container images, including signatures, software bill of materials (SBoM), security scan results or other types.
15
15
16
16

17
17
18
-
To demonstrate this capability, this article shows how to use the [OCI Registry as Storage (ORAS)](https://oras.land) tool to push and pull a graph of artifacts to an Azure container registry.
18
+
To demonstrate this capability, this article shows how to use the [OCI Registry as Storage (ORAS)](https://oras.land) tool to push and pull a graph of supply chain artifacts to an Azure container registry.
19
19
20
-
ORAS Artifacts support is a preview feature and subject to [limitations](#preview-limitations). It requires [zone redundancy](zone-redundancy.md), which is available in the Premium service tier. For information about registry service tiers and limits, see [Azure Container Registry service tiers](container-registry-skus.md).
20
+
Supply chain artifact is a type of [OCI Artifact Manifest][oci-artifact-manifest]. OCI Artifact Manifest support is a preview feature and subject to [limitations](#preview-limitations).
21
21
22
22
## Prerequisites
23
23
24
-
***ORAS CLI** - The ORAS CLI enables attach, copy, push, discover, pull of artifacts to an ORAS Artifacts enabled registry.
24
+
***ORAS CLI** - The ORAS CLI enables attach, copy, push, discover, pull of artifacts to an OCI Artifact Manifest enabled registry.
25
25
***Azure CLI** - To create an identity, list and delete repositories, you need a local installation of the Azure CLI. Version 2.29.1 or later is recommended. Run `az --version `to find the version. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
26
26
***Docker (optional)** - To complete the walkthrough, a container image is referenced. You can use Docker installed locally to build and push a container image, or reference an existing container image. Docker provides packages that easily configure Docker on any [macOS][docker-mac], [Windows][docker-windows], or [Linux][docker-linux] system.
27
27
28
28
## Preview limitations
29
29
30
-
ORAS Artifacts support is not available in the government or China clouds, but available in all other regions.
30
+
OCI Artifact Manifest support is not available in the government or China clouds, but available in all other regions.
31
31
32
32
## ORAS installation
33
33
34
-
Download and install a preview ORAS release for your operating system. See [ORAS installation instructions][oras-install-docs] for how to extract and install the file for your operating system. This article uses ORAS CLI 0.14.1 to demonstrate how to manage supply chain artifacts in ACR.
34
+
Download and install a preview ORAS release for your operating system. See [ORAS installation instructions][oras-install-docs] for how to extract and install ORAS for your operating system. This article uses ORAS CLI 0.16.0 to demonstrate how to manage supply chain artifacts in ACR.
35
35
36
36
## Configure a registry
37
37
@@ -52,9 +52,9 @@ If needed, run the [az group create](/cli/azure/group#az-group-create) command t
52
52
```azurecli
53
53
az group create --name $ACR_NAME --location southcentralus
54
54
```
55
-
### Create ORAS Artifact enabled registry
55
+
### Create OCI Artifact Manifest enabled registry
56
56
57
-
Preview support for ORAS Artifacts requires Zone Redundancy, which requires a Premium service tier, in the South Central US region. Run the [az acr create](/cli/azure/acr#az-acr-create) command to create an ORAS Artifacts enabled registry. See the `az acr create` command help for more registry options.
57
+
Preview support for OCI Artifact Manifest requires Zone Redundancy, which requires a Premium service tier, in the South Central US region. Run the [az acr create](/cli/azure/acr#az-acr-create) command to create an OCI Artifact Manifest enabled registry. See the `az acr create` command help for more registry options.
58
58
59
59
```azurecli
60
60
az acr create \
@@ -65,7 +65,7 @@ az acr create \
65
65
--output jsonc
66
66
```
67
67
68
-
In the command output, note the `zoneRedundancy` property for the registry. When enabled, the registry is zone redundant, and ORAS Artifact enabled.
68
+
In the command output, note the `zoneRedundancy` property for the registry. When enabled, the registry is zone redundant, and OCI Artifact Manifest enabled.
69
69
70
70
```output
71
71
{
@@ -177,13 +177,13 @@ Attach the multi-file artifact as a reference.
177
177
```bash
178
178
oras attach $IMAGE \
179
179
./readme.md:application/markdown \
180
-
./readme-details.md:application/markdown
180
+
./readme-details.md:application/markdown \
181
181
--artifact-type readme/example
182
182
```
183
183
184
184
## Discovering artifact references
185
185
186
-
The ORAS Artifacts Specification defines a [referrers API][oras-artifacts-referrers] for discovering references to a `subject` artifact. The `oras discover` command can show the list of references to the container image.
186
+
The [OCI v1.1 Specification][oci-spec] defines a [referrers API][oci-artifacts-referrers] for discovering references to a `subject` artifact. The `oras discover` command can show the list of references to the container image.
187
187
188
188
Using `oras discover`, view the graph of artifacts now stored in the registry.
The ORAS Artifacts specification enables deep graphs, enabling signed software bill of materials (SBoM) and other artifact types.
206
+
The OCI v1.1 Specification enables deep graphs, enabling signed software bill of materials (SBoM) and other artifact types.
207
207
208
208
### Create a sample SBoM
209
209
@@ -226,7 +226,7 @@ Artifacts that are pushed as references, typically do not have tags as they are
226
226
```bash
227
227
SBOM_DIGEST=$(oras discover -o json \
228
228
--artifact-type sbom/example \
229
-
$IMAGE| jq -r ".referrers[0].digest")
229
+
$IMAGE| jq -r ".manifests[0].digest")
230
230
```
231
231
232
232
Create a signature of an SBoM
@@ -270,7 +270,7 @@ To pull a referenced type, the digest of reference is discovered with the `oras
270
270
```bash
271
271
DOC_DIGEST=$(oras discover -o json \
272
272
--artifact-type 'readme/example' \
273
-
$IMAGE| jq -r ".referrers[0].digest")
273
+
$IMAGE| jq -r ".manifests[0].digest")
274
274
```
275
275
276
276
### Create a clean directory for downloading
@@ -291,7 +291,7 @@ ls ./download
291
291
292
292
## View the repository and tag listing
293
293
294
-
ORAS Artifacts enables artifact graphs to be pushed, discovered, pulled and copied without having to assign tags. This enables a tag listing to focus on the artifacts users think about, as opposed to the signatures and SBoMs that are associated with the container images, helm charts and other artifacts.
294
+
OCI Artifact Manifest enables artifact graphs to be pushed, discovered, pulled and copied without having to assign tags. This enables a tag listing to focus on the artifacts users think about, as opposed to the signatures and SBoMs that are associated with the container images, helm charts and other artifacts.
295
295
296
296
### View a list of tags
297
297
@@ -356,7 +356,7 @@ The signature is untagged, but tracked as a `oras.artifact.manifest` reference t
356
356
```
357
357
## Delete all artifacts in the graph
358
358
359
-
Support for the ORAS Artifacts specification enables deleting the graph of artifacts associated with the root artifact. Use the [az acr repository delete][az-acr-repository-delete] command to delete the signature, SBoM and the signature of the SBoM.
359
+
Support for the OCI v1.1 Specification enables deleting the graph of artifacts associated with the root artifact. Use the [az acr repository delete][az-acr-repository-delete] command to delete the signature, SBoM and the signature of the SBoM.
360
360
361
361
```azurecli
362
362
az acr repository delete \
@@ -376,15 +376,18 @@ az acr manifest list-metadata \
376
376
## Next steps
377
377
378
378
* Learn more about [the ORAS CLI](https://oras.land/cli/)
379
-
* Learn more about [ORAS Artifacts][oras-artifacts] for how to push, discover, pull, copy a graph of supply chain artifacts
379
+
* Learn more about [OCI Artifact Manifest][oci-artifact-manifest] for how to push, discover, pull, copy a graph of supply chain artifacts
0 commit comments