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: _posts/2023-08-22-prebuild.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ If you're already using dev containers, you're likely already familiar with the
33
33
34
34
You need to build your container once it has all the dependencies it needs, and rebuild anytime you add new dependencies. Since you may not need to rebuild often, it might be alright if it takes a while for that initial build. But if you or your teammates need to use that container on another machine, you'll need to wait for it to build again in those new environments.
35
35
36
-
> **Note:** The [dev container CLI doc](/_implementors/reference.md#prebuilding) is another great resource on prebuilding.
36
+
> **Note:** The [dev container CLI doc](/implementors/reference#prebuilding) is another great resource on prebuilding.
@@ -43,14 +43,14 @@ GitHub Codespaces prebuilds help to speed up the creation of new codespaces for
43
43
44
44
By default, whenever you push changes to your repository, GitHub Codespaces uses GitHub Actions to automatically update your prebuilds.
45
45
46
-
You can learn more about codespaces prebuilds and how to manage them in the [codespaces docs]((https://docs.github.com/en/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds)).
46
+
You can learn more about codespaces prebuilds and how to manage them in the [codespaces docs](https://docs.github.com/en/codespaces/prebuilding-your-codespaces/about-github-codespaces-prebuilds).
47
47
48
48
## <ahref="#how-to"name="how-to"class="anchor"> How do I prebuild my image? </a>
49
49
50
50
We try to make prebuilding an image and using a prebuilt image as easy as possible. Let's walk through the couple of steps to get started.
51
51
52
52
**Prebuilding an image:**
53
-
* Install the [Dev Container CLI](/_implementors/reference.md):
53
+
* Install the [Dev Container CLI](/implementors/reference):
54
54
55
55
```bash
56
56
npm install -g @devcontainers/cli
@@ -67,7 +67,7 @@ We try to make prebuilding an image and using a prebuilt image as easy as possib
67
67
**Using a prebuilt image:**
68
68
* Determine the published URL of the prebuilt image you want to use
69
69
* Reference it in your `devcontainer.json`, Dockerfile, or Docker Compose file
70
-
* In our previous guide on ["Using Images, Dockerfiles, and Docker Compose,"](/_posts/2022-12-16-dockerfile.md) we also showed how you can use prebuilt images, Dockerfiles, or Docker Compose files for your configurations
70
+
* In our previous guide on ["Using Images, Dockerfiles, and Docker Compose,"](/guide/dockerfile) we also showed how you can use prebuilt images, Dockerfiles, or Docker Compose files for your configurations
@@ -98,7 +98,7 @@ Let's walk through the Kubernetes prebuild as an example of how you can determin
98
98
* We see it references a prebuilt image, which will include dependencies that don't need to be explicitly mentioned in this end user dev container. Let's next go explore the dev container defining this prebuilt image
99
99
***Explore the dev container defining your prebuilt image**
100
100
* We next open the config that defines the prebuilt image. This is contained in the [`.github/.devcontainer` folder](https://github.com/craiglpeters/kubernetes-devcontainer/tree/master/.github/.devcontainer)
101
-
* We see there's a [`devcontainer.json`](https://github.com/craiglpeters/kubernetes-devcontainer/blob/master/.github/.devcontainer/devcontainer.json). It's much more detailed than the end user dev container we explored above and includes a variety of [Features](/_implementors/features.md)
101
+
* We see there's a [`devcontainer.json`](https://github.com/craiglpeters/kubernetes-devcontainer/blob/master/.github/.devcontainer/devcontainer.json). It's much more detailed than the end user dev container we explored above and includes a variety of [Features](/implementors/features)
102
102
***Explore content in the prebuilt dev container's config**
103
103
* Each Feature defines additional functionality
104
104
* We can explore what each of them installs in their associated repo. Most appear to be defined in the [devcontainers/features repo](https://github.com/devcontainers/features/tree/main/src) as part of the dev container spec
@@ -123,9 +123,9 @@ There are a variety of benefits (some of which we've already explored) to creati
123
123
* We explored the prebuilt images we host as part of the spec in [devcontainers/images](https://github.com/devcontainers/images/tree/main/src). These can form a great base for other dev containers you'd like to create for more complex scenarios
124
124
* The spec has a concept of Development container "Templates" which are source files packaged together that encode configuration for a complete development environment
125
125
* A Template may be as simple as a `devcontainer.json` referencing a prebuilt image, and a `devcontainer-template.json`
126
-
* You can learn more about Templates in our [Templates documentation](../_implementors/templates.md)
127
-
* You can adopt and iterate on [existing Templates](../templates.html) from the spec and community, or you can [create and share your own](../_implementors/templates-distribution.md)
128
-
* 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. You can learn more in our [reference docs](/_implementors/reference.md#metadata-in-image-labels)
126
+
* You can learn more about Templates in our [Templates documentation](../implementors/templates)
127
+
* You can adopt and iterate on [existing Templates](../templates.html) from the spec and community, or you can [create and share your own](../implementors/templates-distribution)
128
+
* 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. You can learn more in our [reference docs](/implementors/reference#labels)
129
129
* You can use multi-stage Dockerfiles to create a prod container from your dev container
130
130
* You'd typically start with your prod image, then add to it
131
131
* Features provide a quick way to add development and CI specific layers that you wouldn't use in production
0 commit comments