Skip to content

Commit 2ab33a5

Browse files
feat(Supporting): add section about CodeSandbox (devcontainers#300)
* Add CodeSandbox config and update Supporting page with CodeSandbox details * fix typos Co-authored-by: Samruddhi Khandale <[email protected]> * fix capitalization of dev containers Co-authored-by: Samruddhi Khandale <[email protected]> --------- Co-authored-by: Samruddhi Khandale <[email protected]>
1 parent 0031c1e commit 2ab33a5

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.codesandbox/tasks.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
// These tasks will run in order when initializing your CodeSandbox project.
3+
"setupTasks": [
4+
{
5+
"name": "Install dependencies",
6+
"command": "bundle install"
7+
}
8+
],
9+
10+
// These tasks can be run from CodeSandbox. Running one will open a log in the app.
11+
"tasks": {
12+
"bundle exec jekyll serve": {
13+
"name": "bundle exec jekyll serve",
14+
"command": "bundle exec jekyll serve --host 0.0.0.0",
15+
"runAtStart": true,
16+
"preview": {
17+
"port": 4000
18+
}
19+
},
20+
"ruby:typecheck": {
21+
"name": "Typecheck",
22+
"command": "solargraph typecheck"
23+
}
24+
}
25+
}

supporting.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,47 @@ Some properties may apply differently to Codespaces.
153153
| `hostRequirements` | object | Codespaces reads this property from devcontainer.json, not image metadata. |
154154
{: .table .table-bordered .table-responsive}
155155

156+
### <a href="#codesandbox" name="codesandbox" class="anchor"> CodeSandbox </a>
157+
158+
[CodeSandbox](https://codesandbox.io/) provides cloud development environments running on a microVM architecture. VM specs start at 2 vCPUs + 2 GB RAM per environment (free tier) and can go up to 16 vCPUs + 32 GB RAM.
159+
160+
When you import a GitHub repository into CodeSandbox, it will automatically provision a dedicated environment for every branch. Thanks to memory snapshotting, CodeSandbox then resumes and branches an environment in under two seconds.
161+
162+
163+
CodeSandbox offers support for multiple editors, so you can code using the CodeSandbox web editor, VS Code, or the CodeSandbox iOS app.
164+
165+
**Tip:** After importing a repository into CodeSandbox, you can use the built-in UI to configure the environment using dev containers.
166+
167+
#### <a href="#codesandbox-specific-properties" name="codesandbox-specific-properties" class="anchor"> Product specific properties </a>
168+
CodeSandbox has built-in support for any programming language and supports Debian and Ubuntu-based images.
169+
170+
All properties specific to CodeSandbox are placed within a `.codesandbox` folder at root level. Typically, this will contain a `tasks.json` file, which defines the commands to be run at startup or with a click.
171+
172+
More details about these can be found in the CodeSandbox [documentation](https://codesandbox.io/docs/learn/repositories/task).
173+
174+
#### Product specific limitations
175+
176+
CodeSandbox runs dev containers using rootless Podman instead of Docker. CodeSandbox also uses [devcontainers/cli](https://github.com/devcontainers/cli) to manage dev containers. So any limitations of rootless Podman and Dev Container CLI should apply to CodeSandbox.
177+
178+
179+
The following properties apply differently to CodeSandbox.
180+
181+
| Property or variable | Type | Description |
182+
|----------|---------|----------------------|
183+
| `forwardPorts` | array | CodeSandbox does not need this property. All ports opened in dev containers will be mapped to a public URL automatically. |
184+
185+
| `portsAttributes` | object | CodeSandbox does not yet support this property. Ports are attached to tasks configured in `.codesandbox/tasks.json` and are attributed to the tasks.|
186+
| `otherPortsAttributes` | object | CodeSandbox does not yet support this property. |
187+
| `remoteUser` | string | CodeSandbox currently ignores this property and overrides this as `root`. CodeSandbox uses rootless Podman to run containers. Running with a non-root remote user is the same as running as a root remote user in rootless Podman, from a security perspective. CodeSandbox plans on supporting this in the future. |
188+
| `shutdownAction` | string | Does not apply to CodeSandbox. |
189+
190+
| `capAdd` | array | CodeSandbox does not support adding docker capabilities. As the containers are run as a non-root user, capabilities that need root access will not work. |
191+
192+
| `features` | object | CodeSandbox automatically adds docker-cli to the container and connects to the host socket. Features like `docker-in-docker` and `docker-outside-of-docker` will work a bit differently. As the docker-cli and socket from host are accessible in the container, most use cases should work as expected. |
193+
| `${localEnv:VARIABLE_NAME}` | Any | For CodeSandbox, the host is in the cloud rather than in your local machine.|
194+
| `hostRequirements` | object | CodeSandbox does not yet support this property. |
195+
{: .table .table-bordered .table-responsive}
196+
156197
### <a href="#devpod" name="devpod" class="anchor"> DevPod </a>
157198

158199
[DevPod](https://github.com/loft-sh/devpod) is a client-only tool to create reproducible developer environments based on a devcontainer.json on any backend. Each developer environment runs in a container and is specified through a devcontainer.json. Through DevPod providers these environments can be created on any backend, such as the local computer, a Kubernetes cluster, any reachable remote machine or in a VM in the cloud.

0 commit comments

Comments
 (0)