Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
563d99d
remove ecs and podman as official templates
bpmct Sep 24, 2023
955a166
kubernetes example
bpmct Sep 24, 2023
143fb04
update frontmatter & remove docker-with-dotfiles
bpmct Sep 26, 2023
41accf0
move jfrog to examples/
bpmct Sep 26, 2023
b5de4e2
fix typo
bpmct Sep 26, 2023
2132a6b
fix icon path
bpmct Sep 26, 2023
e563e15
add aws docs
bpmct Sep 26, 2023
deabf17
add aws-windows
bpmct Sep 26, 2023
4342e05
add azure
bpmct Sep 26, 2023
0fc50b0
add azure windows
bpmct Sep 26, 2023
1bcfec2
add docker
bpmct Sep 26, 2023
ca0dc3b
add devcontainers
bpmct Sep 26, 2023
7efb54a
add devcontainer-k8s and move notes
bpmct Sep 26, 2023
a7cfec9
add digitalocean
bpmct Sep 26, 2023
68b1b2b
add fly.io
bpmct Sep 26, 2023
a9660c3
add gcp windows
bpmct Sep 26, 2023
72caf68
fmt
bpmct Sep 26, 2023
756fc4e
Fix gen
kylecarbs Sep 26, 2023
956af8d
fix icon
matifali Sep 28, 2023
eb0812c
fix icon
matifali Sep 28, 2023
2b867b7
remove unrelated content
matifali Sep 28, 2023
5306f35
Delete examples/templates/fly-docker-image directory
matifali Dec 16, 2023
1614bd3
Update README.md
matifali Dec 16, 2023
688093b
Merge remote-tracking branch 'origin/main' into betterexamples
matifali Dec 16, 2023
207fc07
`make fmt`
matifali Dec 16, 2023
24dd048
Fix AWS authentication typo and update user_data
matifali Dec 16, 2023
886837c
Update GCP VM to use persistent VM
matifali Dec 16, 2023
039028b
Add GCP VM devcontainer templates
matifali Dec 16, 2023
94da748
set count for code-server
matifali Dec 16, 2023
817b277
fix gcp-linux
matifali Dec 16, 2023
6153345
revert gcp-template
matifali Dec 16, 2023
b14aadb
Delete GCP VM Devcontainer template and main.tf
matifali Dec 16, 2023
023f914
`make update-golden-files`
matifali Dec 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add devcontainers
  • Loading branch information
bpmct committed Sep 26, 2023
commit ca0dc3b3b140853cf794b35180d044b9ee40fbf6
48 changes: 30 additions & 18 deletions examples/templates/devcontainer-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,44 @@ verified: true
tags: [container, docker, devcontainer]
---

# devcontainer-docker
# Remote Development on Docker Containers (with Devcontainers)

Develop using [devcontainers](https://containers.dev) in Docker.
Provision Docker containers as [Coder workspaces](https://coder.com/docs/coder-v2/latest) with this example template.

To get started, run `coder templates init`. When prompted, select this template.
Follow the on-screen instructions to proceed.
<!-- TODO: Add screenshot -->

## How it works
## Prerequisites

### Infrastructure

The VM you run Coder on must have a running Docker socket and the `coder` user must be added to the Docker group:

```sh
# Add coder user to Docker group
sudo adduser coder docker

# Restart Coder server
sudo systemctl restart coder

# Test Docker
sudo -u coder docker ps
```

## Architecture

Coder supports devcontainers with [envbuilder](https://github.com/coder/envbuilder), an open source project. Read more about this in [Coder's documentation](https://coder.com/docs/v2/latest/templates/devcontainers).

## code-server
This template provisions the following resources:

`code-server` is installed via the `startup_script` argument in the `coder_agent`
resource block. The `coder_app` resource is defined to access `code-server` through
the dashboard UI over `localhost:13337`.
- Docker image (built by Docker socket and kept locally)
- Docker container pod (ephemeral)
- Docker volume (persistent on `/home/coder`)

## Extending this template
This means, when the workspace restarts, any tools or files outside of the home directory are not persisted. To pre-bake tools into the workspace (e.g. `python3`), modify the container image. Alternatively, individual developers can [personalize](https://coder.com/docs/v2/latest/dotfiles) their workspaces with dotfiles.

See the [kreuzwerker/docker](https://registry.terraform.io/providers/kreuzwerker/docker) Terraform provider documentation to add the following features to your Coder template:
> **Note**
> This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.

- SSH/TCP docker host
- Registry authentication
- Build args
- Volume mounts
- Custom container spec
- More
### Editing the image

We also welcome contributions!
Edit the `Dockerfile` and run `coder templates push` to update workspaces.
2 changes: 1 addition & 1 deletion examples/templates/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [docker, container]

# Remote Development on Docker Containers

Provision Kubernetes Pods as [Coder workspaces](https://coder.com/docs/coder-v2/latest) with this example template.
Provision Docker containers as [Coder workspaces](https://coder.com/docs/coder-v2/latest) with this example template.

<!-- TODO: Add screenshot -->

Expand Down