Skip to content

Commit 9f4619f

Browse files
Update Feature dependency docs to match spec (devcontainers#344)
* update Feature dependency docs to match devcontainers/spec@9ba6c9e * Update _implementors/features.md Co-authored-by: Brigit Murtaugh <[email protected]> --------- Co-authored-by: Brigit Murtaugh <[email protected]>
1 parent fb79460 commit 9f4619f

File tree

2 files changed

+176
-29
lines changed

2 files changed

+176
-29
lines changed

_implementors/features-distribution.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ An OCI registry that implements the [OCI Artifact Distribution Specification](ht
9797

9898
Each packaged Feature is pushed to the registry following the naming convention `<registry>/<namespace>/<id>[:version]`, where version is the major, minor, and patch version of the Feature, according to the semver specification.
9999

100-
> **Note:** The `namespace` is a unique indentifier for the collection of Features. There are no strict rules for the `namespace`; however, one pattern is to set `namespace` equal to source repository's `<owner>/<repo>`.
100+
> **Note:** The `namespace` is a unique identifier for the collection of Features. There are no strict rules for the `namespace`; however, one pattern is to set `namespace` equal to source repository's `<owner>/<repo>`.
101101
102102
A custom media type `application/vnd.devcontainers` and `application/vnd.devcontainers.layer.v1+tar` are used as demonstrated below.
103103

@@ -135,6 +135,35 @@ oras push ${REGISTRY}/${NAMESPACE}:latest \
135135
./devcontainer-collection.json:application/vnd.devcontainers.collection.layer.v1+json
136136
```
137137

138+
Additionally, an [annotation](https://github.com/opencontainers/image-spec/blob/main/annotations.md) named `dev.containers.metadata` should be populated on the manifest when published by an implementing tool. This annotation is the escaped JSON object of the entire `devcontainer-feature.json` as it appears during the [packaging stage](#packaging).
139+
140+
An example manifest with the `dev.containers.metadata` annotation:
141+
142+
```json
143+
{
144+
"schemaVersion": 2,
145+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
146+
"config": {
147+
"mediaType": "application/vnd.devcontainers",
148+
"digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
149+
"size": 0
150+
},
151+
"layers": [
152+
{
153+
"mediaType": "application/vnd.devcontainers.layer.v1+tar",
154+
"digest": "sha256:738af5504b253dc6de51d2cb1556cdb7ce70ab18b2f32b0c2f12650ed6d2e4bc",
155+
"size": 3584,
156+
"annotations": {
157+
"org.opencontainers.image.title": "devcontainer-feature-myFeature.tgz"
158+
}
159+
}
160+
],
161+
"annotations": {
162+
"dev.containers.metadata": "{\"name\": \"My Feature\",\"id\": \"myFeature\",\"version\": \"1.0.0\",\"dependsOn\": {\"ghcr.io/myotherFeature:1\": {\"flag\": true},\"features.azurecr.io/aThirdFeature:1\": {},\"features.azurecr.io/aFourthFeature:1.2.3\": {}}}"
163+
}
164+
}
165+
```
166+
138167
### <a href="#directly-reference-tarball" name="directly-reference-tarball" class="anchor"> Directly referencing a tarball </a>
139168

140169
A Feature can be referenced directly in a user's [`devcontainer.json`](../spec#a-hrefdevcontainerjson-namedevcontainerjson-classanchor-devcontainerjson-a) file by HTTPS URI that points to the tarball from the [package step](#packaging).

0 commit comments

Comments
 (0)