This change adds a new `docker-devcontainer` template which allows you to provision a workspace running in Docker, that also creates workspaces via Docker running inside (DinD). - **chore(examples/templates): rename `docker-devcontainer` to `docker-envbuilder`** - **feat(examples/templates): add `docker-devcontainer` example template**
display_name, description, icon, maintainer_github, verified, tags
display_name | description | icon | maintainer_github | verified | tags | |||
---|---|---|---|---|---|---|---|---|
Docker-in-Docker Dev Containers | Provision Docker containers as Coder workspaces running Dev Containers via Docker-in-Docker. | ../../../site/static/icon/docker.png | coder | true |
|
Remote Development on Dev Containers
Provision Docker containers as Coder workspaces running Dev Containers via Docker-in-Docker.
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:
# 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
This example uses the codercom/enterprise-node:ubuntu
Docker image as a base image for the workspace. It includes necessary tools like Docker and Node.js, which are required for running Dev Containers via the @devcontainers/cli
tool.
This template provisions the following resources:
- Docker image (built by Docker socket and kept locally)
- Docker container (ephemeral)
- Docker volume (persistent on
/home/coder
) - Docker volume (persistent on
/var/lib/docker
)
This means, when the workspace restarts, any tools or files outside of the home directory or docker library are not persisted.
For devcontainers running inside the workspace, data persistence is dependent on each projects devcontainer.json
configuration.
Note
This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.