mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
3e750d104f
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 ```
23 lines
667 B
JSON
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"
|
|
}
|
|
}
|