Files
vercel__next.js/.devcontainer/devcontainer.json
Benjamin Woodruff 3e750d104f Devcontainer: Replace Dockerfile with prebuilt image+features (#82450)
Devcontainers support custom `Dockerfile`s, but it seems like it's more recommended to use a base image with "features" on top: https://containers.dev/implementors/features/

Features get applied after the `Dockerfile`, so e.g. if we're installing `rust` with a feature, then we can't install things that depend on `rust` (e.g. `cargo-nextest`: https://nexte.st/) in the `Dockerfile`. So you're forced to do things with features instead, which can specify dependencies and ordering requirements.

I removed a bunch of comments that were left over from the template. People wishing to update this file should refer to the https://aka.ms/devcontainer.json link at the top of the file.

Also added a lockfile for the features, generated with:

```
devcontainer upgrade --workspace-folder=.
```

**Note:** The `base.Dockerfile` here was entirely unused.


### Testing

```
podman stop --all && podman rm --all  # replace podman with docker if you're using docker
devcontainer up --workspace-folder=.
devcontainer exec --workspace-folder=. zsh
```
2025-08-08 10:14:30 -07:00

23 lines
667 B
JSON

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/javascript-node
{
"name": "Next.js Dev Container",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm",
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
}
},
"remoteUser": "node",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"./rust": {},
"./headless-browser": {},
"./node-extras": {}
},
"remoteEnv": {
"DISPLAY": ":0"
}
}