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
+52-60Lines changed: 52 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Push and pull OCI artifact
2
+
title: Push and pull OCI artifact references
3
3
description: Push and pull Open Container Initiative (OCI) artifacts using a container registry in Azure
4
4
author: SteveLasker
5
5
manager: gwallace
@@ -8,7 +8,7 @@ ms.date: 01/03/2023
8
8
ms.author: stevelas
9
9
---
10
10
11
-
# Push and pull an OCI artifact using an Azure container registry
11
+
# Push and pull OCI artifacts using an Azure container registry
12
12
13
13
You can use an Azure container registry to store and manage [Open Container Initiative (OCI) artifacts](container-registry-image-formats.md#oci-artifacts) as well as Docker and OCI container images.
14
14
@@ -29,7 +29,7 @@ ACR_NAME=myregistry
29
29
REGISTRY=$ACR_NAME.azurecr.io
30
30
```
31
31
32
-
To create a new registry, see [Quickstart: Create a container registry using the Azure CLI][acr-create]
32
+
To create a new registry, see [Quickstart: Create a container registry using the Azure CLI][az-acr-create]
33
33
## Sign in to a registry
34
34
35
35
Authenticate with your [individual Azure AD identity](container-registry-authentication.md?tabs=azure-cli#individual-login-with-azure-ad) using an AD token. Always use "000..." for the `USER_NAME` as the token is parsed through the `PASSWORD` variable.
@@ -56,63 +56,26 @@ Provide the credentials to `oras login`.
56
56
--password $PASSWORD
57
57
```
58
58
59
-
### Sign in with ORAS
60
-
61
-
This section shows options to sign into the registry. Choose one method below appropriate for your environment.
62
-
63
-
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).
59
+
## Push a root artifact
64
60
65
-
- 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.
61
+
A root artifact is an artifact that has no `subject` parent. Root artifacts can be anything from a container image, a helm chart, a readme file for the repository. Reference artifacts, described later are artifacts that refer to another artifact. These can also be anything from a signature, software bill of materials, scan report or other evolving types.
- Authenticate with a [repository scoped token](container-registry-repository-scoped-permissions.md) (Preview) to use non-AD based tokens.
73
-
74
-
```azurecli
75
-
USER_NAME="oras-token"
76
-
PASSWORD=$(az acr token create -n $USER_NAME \
77
-
-r $ACR_NAME \
78
-
--repository $REPO content/write \
79
-
--only-show-errors \
80
-
--query "credentials.passwords[0].value" -o tsv)
81
-
```
82
-
83
-
- 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.
84
-
85
-
```azurecli
86
-
SERVICE_PRINCIPAL_NAME="oras-sp"
87
-
ACR_REGISTRY_ID=$(az acr show --name $ACR_NAME --query id --output tsv)
88
-
PASSWORD=$(az ad sp create-for-rbac --name $SERVICE_PRINCIPAL_NAME \
89
-
--scopes $(az acr show --name $ACR_NAME --query id --output tsv) \
90
-
--role acrpush \
91
-
--query "password" --output tsv)
92
-
USER_NAME=$(az ad sp list --display-name $SERVICE_PRINCIPAL_NAME --query "[].appId" --output tsv)
93
-
```
94
-
95
-
Supply the credentials to `oras login` after authentication configured.
96
-
97
-
```bash
98
-
oras login $REGISTRY \
99
-
--username $USER_NAME \
100
-
--password $PASSWORD
101
-
```
102
-
103
-
To read the password from Stdin, use `--password-stdin`.
104
-
105
-
## Push an artifact
106
-
107
-
Create content that represents a markdown file:
63
+
For this example, create content that represents a markdown file:
108
64
109
65
```bash
110
66
echo'Readme Content'> readme.md
111
67
```
112
68
113
-
Use the `oras push` command to push the file to your registry.
69
+
The following step pushes the `readme.md` file to `<myregistry>.azurecr.io/samples/artifact:readme`.
70
+
- The registry is identified with the fully qualified registry name `<myregistry>.azurecr.io` (all lowercase) with the namespace and repo following: `/samples/artifact`.
71
+
- The artifact is tagged `:readme`, to identify it uniquely from other artifacts listed in the repo (`:latest, :v1, :v1.0.1`).
72
+
- The root artifact, an artifact that doesn't reference another, sets the type through the `-config` parameter.
73
+
-`/dev/null` represents an empty config object, where the value `:readme/example` identifies the artifact type.
74
+
-`:readme/example` differentiates it from a container images which use `application/vnd.oci.image.config.v1+json`.
75
+
- The `./readme.md` identifies the file uploaded, and the `:application/markdown` represents the [IANA `mediaType`][iana-mediatypes] of the file.
76
+
See [OCI Artifact Authors Guidance](https://github.com/opencontainers/artifacts/blob/main/artifact-authors.md) for additional information.
114
77
115
-
The following example pushes the `readme.md` file to the `samples/artifact` repo. The registry is identified with the fully qualified registry name `myregistry.azurecr.io` (all lowercase) with the namespace and repo following. The artifact is tagged `readme`, to identify it uniquely from other artifacts listed in the repo (`latest, v1, v1.0.1`). The type is set through the `-config` parameter. `/dev/null` represents an empty config object, where the `:readme/example` identifies the artifact type, differentiating it from a container images which use `application/vnd.oci.image.config.v1+json`. The `./readme.md` identifies the file uploaded, and the `:application/markdown` represents the IANA `mediaType` of the file. See [OCI Artifacts](https://github.com/opencontainers/artifacts/blob/main/artifact-authors.md) for additional information.
78
+
Use the `oras push` command to push the file to your registry.
Copy file name to clipboardExpand all lines: articles/container-registry/container-registry-oras-artifacts.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ TAG=v1
42
42
IMAGE=$REGISTRY/${REPO}:$TAG
43
43
```
44
44
45
-
To create a new registry, see [Quickstart: Create a container registry using the Azure CLI][acr-create]
45
+
To create a new registry, see [Quickstart: Create a container registry using the Azure CLI][az-acr-create]
46
46
47
47
Authenticate with your [individual Azure AD identity](container-registry-authentication.md?tabs=azure-cli#individual-login-with-azure-ad) using an AD token. Always use "000..." for the `USER_NAME` as the token is parsed through the `PASSWORD` variable.
48
48
@@ -319,6 +319,8 @@ az acr manifest list-metadata \
0 commit comments