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
Templates are distributed as tarballs. The tarball contains the entire contents of the Template sub-directory, including the `devcontainer-template.json`, `.devcontainer.json` (or `.devcontainer/devcontainer.json`), and any other files in the directory.
69
68
70
69
The tarball is named `devcontainer-template-<id>.tgz`, where `<id>` is the Templates's `id` field.
71
70
72
71
A reference implementation for packaging and distributing Templates is provided as a GitHub Action (https://github.com/devcontainers/action).
## <ahref="#guide-to-publishing-templates"name="guide-to-publishing-templates"class="anchor">Guide to publishing Templates</a>
136
+
137
+
The dev container CLI can be used to publish [Dev Container Template](https://containers.dev/implementors/templates/) artifacts to an OCI registry (that supports the [artifacts specification](https://oras.land/implementors/)).
138
+
139
+
To see all the available options, run `devcontainers templates publish --help`.
Given a directory that is organized according to the [Templates distribution specification](https://containers.dev/implementors/templates-distribution/) - for example:
144
+
145
+
```
146
+
├── src
147
+
│ ├── color
148
+
│ │ ├── devcontainer-template.json
149
+
│ │ └──| .devcontainer
150
+
│ │ └── devcontainer.json
151
+
│ ├── hello
152
+
│ │ ├── devcontainer-template.json
153
+
│ │ └──| .devcontainer
154
+
│ │ ├── devcontainer.json
155
+
│ │ └── Dockerfile
156
+
| ├── ...
157
+
│ │ ├── devcontainer-template.json
158
+
│ │ └──| .devcontainer
159
+
│ │ └── devcontainer.json
160
+
├── test
161
+
│ ├── color
162
+
│ │ └── test.sh
163
+
│ ├── hello
164
+
│ │ └── test.sh
165
+
│ └──test-utils
166
+
│ └── test-utils.sh
167
+
...
168
+
```
169
+
170
+
The following command will publish each Template above (`color,hello`) to the registry `ghcr.io` with the following namespace (prefix) `devcontainers/templates`.
> NOTE: OS-specific docker credential helpers (Docker Desktop credential helper) are not currently recognized by the CLI.
187
+
- Adding a $HOME/.docker/config.json with your credentials following [this commonly defined format](https://www.systutorials.com/docs/linux/man/5-docker-config-json/).
188
+
- Your `docker login` command may write this file for you depending on your operating system.
189
+
- Using our custom env variable DEVCONTAINERS_OCI_AUTH
0 commit comments