Document VS Code Dev Containers integration for local and remote Docker
This commit is contained in:
@@ -317,6 +317,28 @@ bun run src/index.ts
|
||||
|
||||
Node modules are stored in your project directory under `/workspace` and persist automatically.
|
||||
|
||||
## VS Code Integration
|
||||
|
||||
VS Code can connect directly to a running opencode-devbox container for a full IDE experience with IntelliSense, debugging, and extensions running inside the container.
|
||||
|
||||
**Requirements:** Install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. For remote Docker hosts, also install [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh).
|
||||
|
||||
**Steps:**
|
||||
|
||||
1. Start the container: `docker compose up -d`
|
||||
2. In VS Code: `Ctrl+Shift+P` → "Dev Containers: Attach to Running Container" → select `opencode-devbox`
|
||||
|
||||
For remote Docker hosts (e.g. connecting to a server via SSH), first connect to the remote host with Remote-SSH, then attach to the container from there.
|
||||
|
||||
VS Code extensions installed inside the container persist as long as the container exists. For persistent extension storage across container recreations, add a named volume:
|
||||
|
||||
```bash
|
||||
docker run -it --rm \
|
||||
-v devbox-vscode:/home/developer/.vscode-server \
|
||||
... \
|
||||
joakimp/opencode-devbox:latest
|
||||
```
|
||||
|
||||
## Using docker-compose
|
||||
|
||||
Create a directory with a `docker-compose.yml` and a `.env` file:
|
||||
|
||||
Reference in New Issue
Block a user