- Home
- Dev Container
- VS Code
VS Code
Prerequisites
Section titled “Prerequisites”- VS Code
- Dev Containers extension (
ms-vscode-remote.remote-containers) - Docker or Podman running on your machine (see Getting Started). VS Code Dev Containers also supports Podman as a backend.
Quick Start
Section titled “Quick Start”git clone https://github.com/f5xc-salesdemos/devcontainer.gitcode devcontainerVS Code detects .devcontainer/devcontainer.json and shows a notification: “Reopen in Container”. Click it, or use the command palette:
Dev Containers: Reopen in Container
VS Code builds (or pulls) the image, starts the container, installs extensions, and opens a terminal inside the container.
How It Works
Section titled “How It Works”The .devcontainer/devcontainer.json file tells VS Code to use Docker Compose:
"dockerComposeFile": ["../docker-compose.yml", "../docker-compose.build.yml"],"service": "dev","workspaceFolder": "/workspace"The devcontainer config explicitly includes the build file, so VS Code can build the image locally when you use “Reopen in Container” or “Rebuild Container”.
Extensions
Section titled “Extensions”Extensions are installed automatically inside the container:
| Extension | Description |
|---|---|
| Python | Python language support |
| ESLint | JavaScript/TypeScript linting |
| Prettier | Code formatting |
| Docker | Dockerfile and compose support |
| Terraform | HCL language support |
| Go | Go language support |
| Rust Analyzer | Rust language support |
| YAML | YAML language support |
| Kubernetes | Kubernetes manifest support |
To add extensions, edit the customizations.vscode.extensions array in .devcontainer/devcontainer.json.
Port Forwarding
Section titled “Port Forwarding”VS Code automatically forwards ports defined in the compose file. The noVNC display is available at http://localhost:6080/vnc.html — VS Code will notify you when the port is ready.
Additional ports can be forwarded on-demand from the Ports panel in VS Code.
Devcontainer CLI Alternative
Section titled “Devcontainer CLI Alternative”If you prefer the command line over the VS Code UI:
npm install -g @devcontainers/cli
devcontainer up --workspace-folder .devcontainer exec --workspace-folder . zshRebuilding
Section titled “Rebuilding”After changing the Dockerfile or compose files:
Dev Containers: Rebuild Container
This rebuilds the image and restarts the container. Named volumes (workspace, home) persist across rebuilds.