Skip to content

Commit 5adf39c

Browse files
bamurtaughbamurtaughsamruddhikhandale
authored
Edit pass for consistency (devcontainers#307)
* Formatting * Update _implementors/features.md Co-authored-by: Samruddhi Khandale <[email protected]> * Add Slack link * Update _implementors/spec.md Co-authored-by: Samruddhi Khandale <[email protected]> --------- Co-authored-by: bamurtaugh <[email protected]> Co-authored-by: Samruddhi Khandale <[email protected]>
1 parent 9e6bb60 commit 5adf39c

12 files changed

+139
-117
lines changed

_implementors/contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: Microsoft
66
index: 9
77
---
88

9-
We're excited for your contributions to the Dev Container Specification! This document outlines how you can get involved.
9+
We're excited for your contributions to the Dev Container Specification! This document outlines how you can get involved. We also welcome you to join our [community Slack channel](https://aka.ms/dev-container-community).
1010

1111
## <a href="#contribution-approaches" name="contribution-approaches" class="anchor"> Contribution approaches </a>
1212

_implementors/features-distribution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ index: 6
88

99
**TL;DR Check out the [quick start repository](https://github.com/devcontainers/feature-template) to get started on distributing your own Dev Container Features.**
1010

11-
This specification defines a pattern where community members and organizations can author and self-publish [Dev Container 'Features'](../features).
11+
This specification defines a pattern where community members and organizations can author and self-publish [Dev Container Features](../features).
1212

1313
Goals include:
1414

@@ -89,7 +89,7 @@ Each Features's `devcontainer-feature.json` metadata file is appended into the `
8989

9090
There are several supported ways to distribute Features. Distribution is handled by the implementing packaging tool such as the [Dev Container CLI](https://github.com/devcontainers/cli) or [Dev Container Publish GitHub Action](https://github.com/marketplace/actions/dev-container-publish). See the [quick start repository](https://github.com/devcontainers/feature-template) for a full working example.
9191

92-
A user references a distributed Feature in a `devcontainer.json` as defined in ['referencing a feature'](../features#referencing-a-feature).
92+
A user references a distributed Feature in a `devcontainer.json` as defined in ['referencing a Feature'](../features#referencing-a-feature).
9393

9494
### <a href="#oci-registry" name="oci-registry" class="anchor"> OCI Registry </a>
9595

@@ -151,7 +151,7 @@ Additional constraints exists when including local Features in a project:
151151

152152
* The project must have a `.devcontainer/` folder at the root of the [**project workspace folder**](/implementors/spec/#project-workspace-folder).
153153

154-
* A local Feature's source code **must** be contained within a sub-folder of the `.devcontainer/ folder`.
154+
* A local Feature's source code **must** be contained within a sub-folder of the `.devcontainer/` folder.
155155

156156
* The sub-folder name **must** match the Feature's `id` field.
157157

_implementors/features.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ author: Microsoft
66
index: 5
77
---
88

9-
Development container "Features" are self-contained, shareable units of installation code and development container configuration. The name comes from the idea that referencing one of them allows you to quickly and easily add more tooling, runtime, or library "Features" into your development container for you or your collaborators to use.
9+
**Development Container Features** are self-contained, shareable units of installation code and development container configuration. The name comes from the idea that referencing one of them allows you to quickly and easily add more tooling, runtime, or library "features" into your development container for you or your collaborators to use.
1010

1111
Feature metadata is captured by a `devcontainer-feature.json` file in the root folder of the feature.
1212

1313
> **Note:** While Features may be installed on top of any base image, the implementation of a Feature might restrict it to a subset of possible base images. For example, some Features may be authored to work with a certain Linux distro (e.g. debian-based images that use the `apt` package manager).
1414
>
15-
> This section covers details on the Features specification. If you are looking for summarized information on creating your own Features, check out the [quick start](https://github.com/devcontainers/feature-starter) and [core Features](https://github.com/devcontainers/features) repositories.
15+
> This page covers details on the Features specification. If you are looking for summarized information on creating your own Features, check out the [quick start](https://github.com/devcontainers/feature-starter) and [core Features](https://github.com/devcontainers/features) repositories.
1616
1717
## <a href="#folder-structure" name="folder-structure" class="anchor"> Folder Structure </a>
1818

@@ -72,15 +72,15 @@ The following lifecycle hooks may be declared as properties of `devcontainer-fea
7272
| `postAttachCommand` | [string, array, object](/implementors/json_reference#formatting-string-vs-array-properties) |
7373
{: .table .table-bordered .table-responsive}
7474

75-
#### Behavior
75+
#### <a href="#behavior" name="behavior" class="anchor"> Behavior </a>
7676

7777
Each property mirrors the behavior of the matching property in [`devcontainer.json`](/implementors/json_reference#Lifecycle-scripts), including the behavior that commands are executed from the context of the [project workspace folder](/implementors/spec/#project-workspace-folder).
7878

7979
For each lifecycle hook (in [Feature installation order](/implementors/features/#installation-order)), each command contributed by a Feature is executed in sequence (blocking the next command from executing). Commands provided by Features are always executed _before_ any user-provided lifecycle commands (i.e: in the `devcontainer.json`).
8080

8181
If a Feature provides a given command with the [object syntax](/implementors/json_reference#formatting-string-vs-array-properties), all commands within that group are executed in parallel, but still blocking commands from subsequent Features and/or the `devcontainer.json`.
8282

83-
> NOTE: These properties are stored within [image metadata](/implementors/spec/#merge-logic).
83+
> **Note**: These properties are stored within [image metadata](/implementors/spec/#merge-logic).
8484
8585
### <a href="#options-property" name="options-property" class="anchor"> The `options` property </a>
8686

@@ -117,11 +117,11 @@ Feature scripts run as the `root` user and sometimes need to know which user acc
117117

118118
Additionally, the home folders of the two users are passed to the Feature scripts as `_REMOTE_USER_HOME` and `_CONTAINER_USER_HOME` environment variables.
119119

120-
The container user can be set with `containerUser` in the devcontainer.json and image metadata, `user` in the docker-compose.yml, `USER` in the Dockerfile, and can be passed down from the base image.
120+
The container user can be set with `containerUser` in the `devcontainer.json` and image metadata, `user` in the `docker-compose.yml`, `USER` in the Dockerfile, and can be passed down from the base image.
121121

122122
### <a href="#dev-container-id" name="dev-container-id" class="anchor"> Dev Container ID </a>
123123

124-
An identifier will be referred to as `${devcontainerId}` in the devcontainer.json and the Feature metadata and that will be replaced with the dev container's id. It should only be used in parts of the configuration and metadata that is not used for building the image because that would otherwise prevent pre-building the image at a time when the dev container's id is not known yet. Excluding boolean, numbers and enum properties the properties supporting `${devcontainerId}` in the Feature metadata are: `entrypoint`, `mounts`, `customizations`.
124+
An identifier will be referred to as `${devcontainerId}` in the `devcontainer.json` and the Feature metadata and that will be replaced with the dev container's id. It should only be used in parts of the configuration and metadata that is not used for building the image because that would otherwise prevent pre-building the image at a time when the dev container's id is not known yet. Excluding boolean, numbers and enum properties the properties supporting `${devcontainerId}` in the Feature metadata are: `entrypoint`, `mounts`, `customizations`.
125125

126126
Implementations can choose how to compute this identifier. They must ensure that it is unique among other dev containers on the same Docker host and that it is stable across rebuilds of dev containers. The identifier must only contain alphanumeric characters. We describe a way to do this below.
127127

@@ -218,7 +218,7 @@ As a shorthand, the value of the `features` property can be provided as a single
218218
}
219219
```
220220

221-
### <a href="#referencing-a-feature" name="referencing-a-feature" class="anchor"> Referencing a feature </a>
221+
### <a href="#referencing-a-feature" name="referencing-a-feature" class="anchor"> Referencing a Feature </a>
222222

223223
The `id` format specified dicates how a supporting tool will locate and download a given feature. `id` is one of the following:
224224

@@ -251,7 +251,7 @@ If the Feature is included in a folder as part of the repository that contains `
251251

252252
## <a href="#release" name="release" class="anchor"> Release </a>
253253

254-
_For information on distributing Features, see [the dev container Features distribution page](../features-distribution)._
254+
_For information on distributing Features, see the [Features distribution page](../features-distribution)._
255255

256256
## <a href="#execution" name="execution" class="anchor"> Execution </a>
257257

@@ -313,11 +313,11 @@ After `overrideFeatureInstallOrder` is resolved, any remaining Features that dec
313313

314314
### <a href="#option-resolution" name="option-resolution" class="anchor"> Option Resolution </a>
315315

316-
A Feature's 'options' - specified as the value of a single Feature key/value pair in the user's `devcontainer.json` - are passed to the Feature as environment variables.
316+
A Feature's `options` - specified as the value of a single Feature key/value pair in the user's `devcontainer.json` - are passed to the Feature as environment variables.
317317

318318
A supporting tool will parse the `options` object provided by the user. If a value is provided for a Feature, it will be emitted to a file named `devcontainer-features.env` following the format `<OPTION_NAME>=<value>`.
319319

320-
To ensure a option that is valid as an environment variable, the follow substitutions are performed.
320+
To ensure a option that is valid as an environment variable, the follow substitutions are performed:
321321

322322
```javascript
323323
(str: string) => str

_implementors/reference.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ author: Microsoft
66
index: 2
77
---
88

9-
The reference implementation for the specification is available through a [development container CLI](https://github.com/devcontainers/cli). This CLI can take a devcontainer.json and create and configure a dev container from it.
9+
The reference implementation for the specification is available through a [development container CLI](https://github.com/devcontainers/cli). This CLI can take a `devcontainer.json` and create and configure a dev container from it.
1010

11-
## <a href="#what-is-CLI" name="what-is-CLI" class="anchor"> What is the dev container CLI? </a>
12-
When tools like VS Code and Codespaces detect a devcontainer.json file in a user's project, they use a CLI to configure a dev container. We've now opened up this CLI as a reference implementation so that individual users and other tools can read in devcontainer.json metadata and create dev containers from it.
11+
## <a href="#what-is-CLI" name="what-is-CLI" class="anchor"> What is the Dev Container CLI? </a>
12+
When tools like VS Code and Codespaces detect a `devcontainer.json` file in a user's project, they use a CLI to configure a dev container. We've now opened up this CLI as a reference implementation so that individual users and other tools can read in `devcontainer.json` metadata and create dev containers from it.
1313

1414
This CLI can either be used directly or integrated into product experiences, similar to how it's integrated with Dev Containers and Codespaces today. It currently supports both a simple single container option and integrates with [Docker Compose](https://docs.docker.com/compose/) for multi-container scenarios.
1515

16-
The CLI is available for review in a new [devcontainers/cli](https://github.com/devcontainers/cli) repository, and you can read more about its development in [this issue](https://github.com/devcontainers/spec/issues/9) in the spec repo.
16+
The CLI is available in the [devcontainers/cli](https://github.com/devcontainers/cli) repository.
1717

1818
## <a href="#try-it" name="try-it" class="anchor"> How can I try it? </a>
1919

20-
We'd love for you to try out the dev container CLI and let us know what you think. You can quickly try it out in just a few simple steps, either by installing its npm package or building the CLI repo from sources.
20+
We'd love for you to try out the Dev Container CLI and let us know what you think. You can quickly try it out in just a few simple steps, either by installing its npm package or building the CLI repo from sources.
2121

2222
You may learn more about building from sources in the [CLI repo's README](https://github.com/devcontainers/cli#try-it-out). On this page, we'll focus on using the npm package.
2323

@@ -97,7 +97,7 @@ Hello, VS Code Remote - Containers!
9797
{"outcome":"success"}
9898
```
9999

100-
Congrats, you've just run the dev container CLI and seen it in action!
100+
Congrats, you've just run the Dev Container CLI and seen it in action!
101101

102102
These steps are also provided in the CLI repo's [README](https://github.com/devcontainers/cli/blob/main/README.md). You may also review frequently asked questions [here](https://github.com/devcontainers/spec/issues/31).
103103

@@ -110,13 +110,15 @@ We recommend using the [Dev Container CLI](#npm-install) (or other spec supporti
110110
devcontainer build --workspace-folder . --push true --image-name <my_image_name>:<optional_image_version>
111111
```
112112

113+
You can also check out our [in-depth guide on prebuilds](/_posts/2023-08-22-prebuild.md).
114+
113115
#### <a href="#labels" name="labels" class="anchor"> Metadata in image labels</a>
114116

115117
You can include Dev Container configuration and Feature metadata in prebuilt images via [image labels](https://docs.docker.com/config/labels-custom-metadata/). This makes the image self-contained since these settings are automatically picked up when the image is referenced - whether directly, in a `FROM` in a referenced Dockerfile, or in a Docker Compose file. This helps prevent your Dev Container config and image contents from getting out of sync, and allows you to push updates of the same configuration to multiple repositories through a simple image reference.
116118

117-
This metadata label is **automatically added** when you pre-build using the [Dev Container CLI](#npm-install) (or other spec supporting utilities like the [GitHub Action](https://github.com/marketplace/actions/devcontainers-ci) or [Azure DevOps task](https://marketplace.visualstudio.com/items?itemName=devcontainers.ci)) and includes settings from devcontainer.json and any referenced Dev Container Features.
119+
This metadata label is **automatically added** when you pre-build using the [Dev Container CLI](#npm-install) (or other spec supporting utilities like the [GitHub Action](https://github.com/marketplace/actions/devcontainers-ci) or [Azure DevOps task](https://marketplace.visualstudio.com/items?itemName=devcontainers.ci)) and includes settings from `devcontainer.json` and any referenced Dev Container Features.
118120

119-
This allows you to have a separate **more complex** devcontainer.json you use to pre-build your image, and then a dramatically **simplified one** in one or more repositories. The contents of the image will be merged with this simplified devcontainer.json content at the time you create the container (see the [the spec](/implementors/spec/#merge-logic) for info on merge logic). But at its simplest, you can just reference the image directly in devcontainer.json for the settings to take effect:
121+
This allows you to have a separate **more complex** `devcontainer.json` you use to pre-build your image, and then a dramatically **simplified one** in one or more repositories. The contents of the image will be merged with this simplified devcontainer.json content at the time you create the container (see the [the spec](/implementors/spec/#merge-logic) for info on merge logic). But at its simplest, you can just reference the image directly in `devcontainer.json` for the settings to take effect:
120122

121123
```json
122124
{
@@ -138,7 +140,7 @@ See the [Dev Container metadata reference](../json_reference) for information on
138140

139141
### <a href="#domainnames" name="domainnames" class="anchor"> Domain Names </a>
140142

141-
If you are behind a firewall that needs to allow specific domains used by the dev container CLI, here's the list of hostnames you should allow communication to go through:
143+
If you are behind a firewall that needs to allow specific domains used by the Dev Container CLI, here's the list of hostnames you should allow communication to go through:
142144

143145
* `containers.dev` - The [homepage](https://containers.dev/) for everything about dev containers. It includes all official and community-supported [Features](https://containers.dev/features) and [Templates](https://containers.dev/templates).
144146
* `ghcr.io`, `*.azurecr.io`, `mcr.microsoft.com` - [OCI registries](https://containers.dev/implementors/features-distribution/#oci-registry) like [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry), [Azure Container Registry](azure.microsoft.com/en-us/products/container-registry), and [Microsoft Container Registry](https://mcr.microsoft.com/en-us/catalog?search=dev%20container) serves as the primary distribution mechanism for dev container resources.

0 commit comments

Comments
 (0)