- Notifications
You must be signed in to change notification settings - Fork1.1k
docs: improve dev containers documentation for user start-up#15458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
39 commits Select commitHold shift + click to select a range
d741460 add definitions to admin/index
EdwardAngert3ed5c3e init devcontainers best practice doc
EdwardAngertdcf901c s/definition list/bullets
EdwardAngert16cce07 Merge remote-tracking branch 'origin' into bp-dev-containers
EdwardAngerte96b1bc admin/index glossary section
EdwardAngert22e399d when to use a dev container
EdwardAngert4f91cd0 Merge remote-tracking branch 'origin' into bp-dev-containers
EdwardAngert8e37e58 admin/index glossary; devcontainer known issues
EdwardAngert985233a devcontainer lifecycle scripts
EdwardAngertf2c59be devcontainers directory
EdwardAngertb24f615 fix typo
EdwardAngert4c28411 make fmt
EdwardAngertfc20dc3 suggestions from review
EdwardAngert197cfa7 add steps in tabs to add-devcontainer
EdwardAngert5a93ff2 fix links; list templates
EdwardAngert8e53735 make fmt + copy review addition
EdwardAngert80bf5da fix link
EdwardAngertca56186 typo fix
EdwardAngert1491680 copy edit devcontainer/index
EdwardAngert7f8b079 edit add-devcontainer
EdwardAngert547cfe0 Apply suggestions from code review
EdwardAngertd22f76f add screenshot
EdwardAngertce0d2be make fmt; copy tweaks
EdwardAngert66fcca0 edit example
EdwardAngertde58159 link typo
EdwardAngert69415d4 adjust image size
EdwardAngertae543de Apply suggestions from code review
EdwardAngertca0da6d Apply suggestions from code review
EdwardAngert381bb73 make fmt
EdwardAngertade54e9 close codeblock; edit starter template steps
EdwardAngerte46fc13 code review
9982af4 make fmt
182d69a rename to dev containers
bf2e0fa 2-col table
EdwardAngertcd99937 make fmt
d17dbea un-double bullet def list
2c3ca6d s/devcontainer/dev container
c28f16d comma typo
f344dff Merge remote-tracking branch 'origin' into bp-dev-containers
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
add steps in tabs to add-devcontainer
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit197cfa748576876d5ebd4c07b5be3d5305a7341d
There are no files selected for viewing
85 changes: 75 additions & 10 deletionsdocs/admin/templates/managing-templates/devcontainers/add-devcontainer.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,80 @@ | ||
| # Add adev container template to Coder | ||
| A Coder administrator adds adev container-compatible template to Coder | ||
| (Envbuilder). | ||
| When a developer creates their workspace, they enter their repository URL as a | ||
| [parameter](../../extending-templates/parameters.md). Envbuilder clones the repo | ||
| and builds a container from the `devcontainer.json` specified in the repo. | ||
| //tabs UI | CLI | Registry (/starter-templates?tag=devcontainer) | ||
| <div class="tabs"> | ||
| ## Dashboard | ||
| 1. In the Coder dashboard, select **Templates** then **Create Template**. | ||
| 1. To use a [starter template](https://github.com/coder/coder/tree/main/examples/templates), select **Choose a starter template**. | ||
| - Select **From scratch** to create a new template and enter information and file contents manually. | ||
| ## CLI | ||
| 1. Use the `template init` command to initialize your choice of image: | ||
| ```shell | ||
| coder template init --id devcontainer-kubernetes | ||
| ``` | ||
| 1. `cd` into the directory and push the template to your Coder deployment: | ||
| ```shell | ||
| cd $_ && coder templates push | ||
| ``` | ||
| You can also edit the files or make changes to the files before you push them to Coder. | ||
| ## Registry | ||
| 1. Go to the [Coder Registry](https://registry.coder.com/templates?tag=devcontainer) and select a dev container-compatible template. | ||
| 1. Copy the files to your local device, then edit them to fit your needs. | ||
| 1. Upload them to Coder through the CLI or dashboard: | ||
| - CLI: | ||
| ```shell | ||
| coder template push | ||
EdwardAngert marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ``` | ||
| - Dashboard: | ||
| 1. Create a `.zip` of the template files: | ||
| - On Mac or Windows, highlight the files and then right click. A "compress" option is available through the right-click context menu. | ||
| - To zip the files through the command line: | ||
| ```shell | ||
| zip templates.zip Dockerfile main.tf | ||
| ``` | ||
| 1. Select **Templates**. | ||
| 1. Select **Create Template**, then **Upload template**: | ||
|  | ||
| 1. Drag the `.zip` file into the **Upload template** section and fill out the details, then select **Create template**. | ||
|  | ||
| 1. Once the upload completes, select **Templates** from the top to deploy it to a new workspace. | ||
| </div> | ||
| Admin: | ||
| 1. Use a [dev container template](https://registry.coder.com/templates) | ||
| 1. Create a template with the template files from the registry (git clone, | ||
| upload files, or copy paste) | ||
| 1. In template settings > variables > set necessary variables such as the | ||
| @@ -47,25 +112,25 @@ | ||
| ## Example templates | ||
| - [Dockerdev containers](https://github.com/coder/coder/tree/main/examples/templates/devcontainer-docker) | ||
| - Docker provisions a development container. | ||
| - [Kubernetesdev ontainers](https://github.com/coder/coder/tree/main/examples/templates/devcontainer-kubernetes) | ||
| - Provisions a development container on the Kubernetes. | ||
| - [Google Compute Enginedev container](https://github.com/coder/coder/tree/main/examples/templates/gcp-devcontainer) | ||
| - Runs a development container inside a single GCP instance. It also mounts | ||
| the Docker socket from the VM inside the container to enable Docker inside | ||
| the workspace. | ||
| - [AWS EC2dev container](https://github.com/coder/coder/tree/main/examples/templates/aws-devcontainer) | ||
| - Runs a development container inside a single EC2 instance. It also mounts | ||
| the Docker socket from the VM inside the container to enable Docker inside | ||
| the workspace. | ||
| Your template can prompt the user for a repo URL with | ||
| [parameters](../../extending-templates/parameters.md): | ||
|  | ||
| ##Dev container lifecycle scripts | ||
| The `onCreateCommand`, `updateContentCommand`, `postCreateCommand`, and | ||
| `postStartCommand` lifecycle scripts are run each time the container is started. | ||
| @@ -76,4 +141,4 @@ | ||
| ## Next steps | ||
| - [Dev container security and caching](./devcontainer-security-caching.md) | ||
25 changes: 1 addition & 24 deletions...emplates/managing-templates/devcontainers/devcontainer-releases-known-issues.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions...min/templates/managing-templates/devcontainers/devcontainer-security-caching.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiondocs/admin/templates/managing-templates/devcontainers/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletionsdocs/manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -321,23 +321,23 @@ | ||
| "path": "./admin/templates/managing-templates/change-management.md" | ||
| }, | ||
| { | ||
| "title": "Development containers", | ||
EdwardAngert marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| "description": "Learn about usingdev containers in templates", | ||
| "path": "./admin/templates/managing-templates/devcontainers/index.md", | ||
| "children": [ | ||
| { | ||
| "title": "Add adev container template", | ||
| "description": "How to add adev container template to Coder", | ||
| "path": "./admin/templates/managing-templates/devcontainers/add-devcontainer.md" | ||
| }, | ||
| { | ||
| "title": "Dev container security and caching", | ||
| "description": "Configuredev container authentication and caching", | ||
| "path": "./admin/templates/managing-templates/devcontainers/devcontainer-security-caching.md" | ||
| }, | ||
| { | ||
| "title": "Dev container releases and known issues", | ||
| "description": "Dev container releases and known issues", | ||
| "path": "./admin/templates/managing-templates/devcontainers/devcontainer-releases-known-issues.md" | ||
| } | ||
| ] | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.