Skip to content

Commit 58c1a70

Browse files
authored
Add a HowTo blog (devcontainers#79)
* create a blog * fix hyperlinks * review feedback * rename to guides
1 parent e91a991 commit 58c1a70

File tree

5 files changed

+42
-19
lines changed

5 files changed

+42
-19
lines changed

_config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ defaults:
3333
type: posts
3434
values:
3535
layout: post
36-
sectionid: blog
36+
sectionid: guide
3737

3838
- scope:
3939
path: _docs
@@ -56,7 +56,7 @@ collections:
5656
permalink: /:collection/:path/
5757
output: true
5858
posts:
59-
permalink: /blog/:year/:month/:day/:title/
59+
permalink: /guide/:title
6060
output: true
6161
implementors:
6262
permalink: /:collection/:path/

_includes/topnav.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ <h1>Development Containers</h1>
1818
<a class="nav-link" href="{{ sorted.first.url | prepend: site.baseurl }}">Implementations</a>
1919
</li>-->
2020
<li {% if page.sectionid=='metadata' %} class="nav-item active" {% else %} class="nav-item" {% endif %}>
21-
<a class="nav-link" href="{{ "/implementors/json_reference" | prepend: site.baseurl }}">Metadata</a>
21+
<a class="nav-link" href="{{ "/implementors/json_reference" | prepend: site.baseurl }}">Reference</a>
2222
</li>
2323
<li {% if page.sectionid=='implementors' %} class="nav-item active" {% else %} class="nav-item" {% endif %}>
2424
<a class="nav-link" href="{{ sorted.first.url | prepend: site.baseurl }}">Specification</a>
2525
</li>
2626
<li {% if page.sectionid=='supporting' %} class="nav-item active" {% else %} class="nav-item" {% endif %}>
2727
<a class="nav-link" href='{{ "/supporting" | prepend: site.baseurl }}'>Supporting Tools</a>
2828
</li>
29+
<li {% if page.sectionid=='guides' %} class="nav-item active" {% else %} class="nav-item" {% endif %}>
30+
<a class="nav-link" href='{{ "/guides" | prepend: site.baseurl }}'>Guides</a>
31+
</li>
2932
<li {% if page.sectionid=='features' %} class="nav-item active" {% else %} class="nav-item" {% endif %}>
3033
<a class="nav-link" href='{{ "/features" | prepend: site.baseurl }}'>Available Features</a>
3134
</li>

_layouts/post.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: singlePage
3+
---
4+
<div class="container">
5+
<p>{{ page.date | date_to_string }} - <a href="{{ page.authorUrl }}">{{ page.author }}</a></p>
6+
7+
{{ content }}
8+
</div>

_implementors/create-feature.md renamed to _posts/2022-11-01-author-a-feature.md

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
---
2-
layout: implementors
3-
title: "Create a Feature"
4-
shortTitle: "Create a Feature"
5-
author: Microsoft
6-
index: 7
2+
layout: post
3+
title: "Authoring a Dev Container Feature"
4+
author: "@joshspicer"
5+
authorUrl: https://github.com/joshspicer
76
---
87

9-
Development container ['Features'](../features) are self-contained, shareable units of installation code and development container configuration. We [define a pattern](../features-distribution) for authoring and self-publishing Features.
8+
Development container ['Features'](/features) are self-contained, shareable units of installation code and development container configuration. We [define a pattern](/implementors/features-distribution) for authoring and self-publishing Features.
109

11-
In this document, we'll outline a "quickstart" to help you get up-and-running with creating and sharing your first Feature. You may review an example along with guidance in our [devcontainers/feature-template](https://github.com/devcontainers/feature-template) repo as well.
10+
In this document, we'll outline a "quickstart" to help you get up-and-running with creating and sharing your first Feature. You may review an example along with guidance in our [devcontainers/feature-starter](https://github.com/devcontainers/feature-starter) repo as well.
1211

1312
> Note: While this walkthrough will illustrate the use of GitHub and the GitHub Container Registry, you can use your own source control system and publish to any [OCI Artifact supporting](https://oras.land/implementors/#registries-supporting-oci-artifacts) container registry instead.
1413
1514
## <a href="#create-repo" name="create-repo" class="anchor"> Create a repo </a>
1615

1716
Start off by creating a repository to host your Feature. In this guide, we'll use a public GitHub repository.
1817

19-
For the simplest getting started experience, you may use our example [feature-template](https://github.com/devcontainers/feature-template) repo. You may select the green `Use this template` button on the repo's page.
18+
For the simplest getting started experience, you may use our example [feature-starter](https://github.com/devcontainers/feature-starter) repo. You may select the green `Use this template` button on the repo's page.
2019

2120
You may also [create your own repo on GitHub](https://docs.github.com/en/get-started/quickstart/create-a-repo) if you'd prefer.
2221

2322
## <a href="#create-folder" name="create-folder" class="anchor"> Create a folder </a>
2423

25-
Once you've forked the feature-template repo (or created your own), you'll want to create a folder for your Feature. You may create one within the [`src`](https://github.com/devcontainers/feature-template/tree/main/src) folder.
24+
Once you've forked the feature-starter repo (or created your own), you'll want to create a folder for your Feature. You may create one within the [`src`](https://github.com/devcontainers/feature-starter/tree/main/src) folder.
2625

2726
If you'd like to create multiple Features, you may add multiple folders within `src`.
2827

2928
## <a href="#add-files" name="add-files" class="anchor"> Add files </a>
3029

3130
At a minimum, a Feature will include a `devcontainer-feature.json` and an `install.sh` entrypoint script.
3231

33-
There are many possible properties for `devcontainer-feature.json`, which you may review in the [Features spec](../features#devcontainer-feature-json-properties).
32+
There are many possible properties for `devcontainer-feature.json`, which you may review in the [Features spec](/features#devcontainer-feature-json-properties).
3433

3534
Below is a hello world example `devcontainer-feature.json` and `install.sh`. You may review the [devcontainers/features](https://github.com/devcontainers/features/blob/main/src) repo for more examples.
3635

37-
[devcontainer-feature.json](https://github.com/devcontainers/feature-template/blob/main/src/hello/devcontainer-feature.json):
36+
[devcontainer-feature.json](https://github.com/devcontainers/feature-starter/blob/main/src/hello/devcontainer-feature.json):
3837

3938
```json
4039
{
@@ -58,7 +57,7 @@ Below is a hello world example `devcontainer-feature.json` and `install.sh`. You
5857
}
5958
```
6059

61-
[install.sh](https://github.com/devcontainers/feature-template/blob/main/src/hello/install.sh):
60+
[install.sh](https://github.com/devcontainers/feature-starter/blob/main/src/hello/install.sh):
6261

6362
```bash
6463
#!/bin/sh
@@ -82,11 +81,11 @@ chmod +x /usr/local/bin/hello
8281

8382
## <a href="#publishing" name="publishing" class="anchor"> Publishing </a>
8483

85-
The feature-template repo contains a GitHub Action [workflow](https://github.com/devcontainers/feature-template/blob/main/.github/workflows/release.yaml) that will publish each feature to GHCR. By default, each feature will be prefixed with the `<owner/<repo>` namespace. Using the hello world example from above, it can be referenced in a `devcontainer.json` with: `ghcr.io/devcontainers/feature-template/color:1`.
84+
The `feature-starter` repo contains a GitHub Action [workflow](https://github.com/devcontainers/feature-starter/blob/main/.github/workflows/release.yaml) that will publish each feature to GHCR. By default, each feature will be prefixed with the `<owner/<repo>` namespace. Using the hello world example from above, it can be referenced in a `devcontainer.json` with: `ghcr.io/devcontainers/feature-starter/color:1`.
8685

8786
> Note: You can use the `devcontainer features publish` command from the [Dev Container CLI](https://github.com/devcontainers/cli) if you are not using GitHub Actions.
8887
89-
The provided GitHub Action will also publish a third "metadata" package with just the namespace, eg: `ghcr.io/devcontainers/feature-template`, which is known as the Feature collection namespace.
88+
The provided GitHub Action will also publish a third "metadata" package with just the namespace, eg: `ghcr.io/devcontainers/feature-starter. This is useful for supporting tools to [crawl](#add-to-index) metadata about available Features in the collection without downloading _all the Features individually_.
9089

9190
By default, GHCR packages are marked as private. To stay within the free tier, Features need to be marked as public.
9291

@@ -100,10 +99,10 @@ https://github.com/users/<owner>/packages/container/<repo>%2F<featureName>/setti
10099

101100
## <a href="#add-to-index" name="add-to-index" class="anchor"> Adding Features to the Index </a>
102101

103-
If you'd like your Features to appear in our [public index](https://containers.dev/features) so that other community members can find them, you can do the following:
102+
If you'd like your Features to appear in our [public index](/features) so that other community members can find them, you can do the following:
104103

105104
* Go to [github.com/devcontainers/devcontainers.github.io](github.com/devcontainers/devcontainers.github.io), which is the GitHub repo backing [containers.dev](https://containers.dev/)
106105
* Open a PR to modify the [collection-index.yml](https://github.com/devcontainers/devcontainers.github.io/blob/gh-pages/_data/collection-index.yml) file
107106
* Features housed in other OCI Artifact container registries can be included as long as they can be downloaded without a login.
108107

109-
Feature collections are scanned to populate a Feature index on the [containers.dev site](../../features) and allow them to appear in Dev Container creation UX in [supporting tools](https://containers.dev/supporting) like [VS Code Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and [GitHub Codespaces](https://github.com/features/codespaces).
108+
Feature collections are scanned to populate a Feature index on the [containers.dev site](/features) and allow them to appear in Dev Container creation UX in [supporting tools](https://containers.dev/supporting) like [VS Code Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and [GitHub Codespaces](https://github.com/features/codespaces).

guides.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: singlePage
3+
title: Dev Container Guides
4+
---
5+
6+
{% for post in site.posts %}
7+
<p>
8+
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
9+
<p>{{ post.date | date_to_string }}</a></p>
10+
11+
{{ post.excerpt }}
12+
</p>
13+
{% endfor %}

0 commit comments

Comments
 (0)