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: proposals/devcontainer-templates-distribution.md
+12-7
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,9 @@ Each sub-directory should be named such that it matches the `id` field of the `d
50
50
51
51
## Versioning
52
52
53
-
Each Template is published with only the `latest` tag. Tooling that handles releasing Templates will republish the `latest` tag every time a new release is created.
53
+
Each Template is individually [versioned according to the semver specification](https://semver.org/). The `version` property in the respective `devcontainer-template.json` file is parsed to determine if the Template should be republished.
54
+
55
+
Tooling that handles publishing Templates will not republish Templates if that exact version has already been published; however, tooling must republish major and minor versions in accordance with the semver specification.
54
56
55
57
## Packaging
56
58
@@ -81,27 +83,30 @@ A user can add a Template in to their projects as defined by the [supporting Too
81
83
82
84
An OCI registry that implements the [OCI Artifact Distribution Specification](https://github.com/opencontainers/distribution-spec) serves as the primary distribution mechanism for Templates.
83
85
84
-
Each packaged Template is pushed to the registry following the naming convention `<registry>/<namespace>/<id>[:latest]`.
86
+
Each packaged Template is pushed to the registry following the naming convention `<registry>/<namespace>/<id>[:version]`, where version is the major, minor, and patch version of the Template, according to the semver specification.
85
87
86
88
> **Note:** The `namespace` is a unique identifier for the collection of Templates and must be different than the collection of [Features](./devcontainer-features.md). There are no strict rules for the `namespace`; however, one pattern is to set `namespace` equal to source repository's `<owner>/<repo>`.
87
89
88
90
A custom media type `application/vnd.devcontainers` and `application/vnd.devcontainers.layer.v1+tar` are used as demonstrated below.
89
91
90
-
For example, the `go` Template in the `devcontainers/templates` namespace would be pushed to the ghcr.io OCI registry with the `latest` tag.
92
+
For example, the `go` Template in the `devcontainers/templates` namespace at version `1.2.3`would be pushed to the ghcr.io OCI registry.
91
93
92
94
> **Note:** The example below uses [`oras`](https://oras.land/) for demonstration purposes. A supporting tool should directly implement the required functionality from the aforementioned OCI artifact distribution specification.
Copy file name to clipboardExpand all lines: proposals/devcontainer-templates.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -68,11 +68,19 @@ The `options` property contains a map of option IDs and their related configurat
68
68
69
69
### Referencing a Template
70
70
71
-
The `id` format (`<oci-registry>/<namespace>/<template>[:latest]`) dictates how a [supporting tool](../docs/specs/supporting-tools.md#supporting-tools-and-services) will locate and download a given Template from an OCI registry (For example - `ghcr.io/user/repo/go:latest`). The registry must implement the [OCI Artifact Distribution Specification](https://github.com/opencontainers/distribution-spec). Some implementors can be [found here](https://oras.land/implementors/).
71
+
The `id` format (`<oci-registry>/<namespace>/<template>[:<semantic-version>]`) dictates how a [supporting tool](https://containers.dev/supporting) will locate and download a given Template from an OCI registry. For example:
72
+
73
+
-`ghcr.io/user/repo/go`
74
+
-`ghcr.io/user/repo/go:1`
75
+
-`ghcr.io/user/repo/go:latest`
76
+
77
+
The registry must implement the [OCI Artifact Distribution Specification](https://github.com/opencontainers/distribution-spec). Some implementors can be [found here](https://oras.land/implementors/).
72
78
73
79
## Versioning
74
80
75
-
Each Template is published with only the `latest` tag. Tooling that handles releasing Templates will republish the `latest` tag every time a new release is created.
81
+
Each Template is individually [versioned according to the semver specification](https://semver.org/). The `version` property in the respective `devcontainer-template.json` file is updated to increment the Template's version.
82
+
83
+
Tooling that handles releasing Templates will not republish Templates if that exact version has already been published; however, tooling must republish major and minor versions in accordance with the semver specification.
0 commit comments