Cheatography
https://cheatography.com
Visual Studio Code DevContainers Cheat Sheet
Files and Directories
Devcontainer specific files are in the .devcontainer
directory at the root of the project. |
The main configuration file is devcontainer.json
in the .devcontainer
directory. |
mcr.microsoft.com/vscode/devcontainers/...
base |
python |
ruby |
dotnet |
javascript-node |
cpp |
go |
anaconda |
typescript-node |
php |
java |
miniconda |
universal |
rust |
dotnetcore |
jekyll |
Dockerfile tag list
debian-10 ("buster") and ubuntu-20.04 ("focal") are not always available for the ARM64 architecture (Mac M1)
.devcontainer
|
string |
Name of the image in a container registry |
build.dockerfile
/ dockerFile
|
string |
Location of the Dockerfile that defines the contents of the container |
|
string, array |
Path or an ordered list of paths to Docker Compose files relative to the devcontainer.json
file |
|
string |
Name of the service VS Code should connect to once running |
Simple .devcontainer with Docker image
{
"name": "Go Demo",
"image": "mcr.microsoft.com/vscode/devcontainers/go:1.18-bullseye"
}
|
.devcontainer with Dockerfile
{
"name": "Dockerfile Example",
"build": {
"dockerfile": "Dockerfile"
}
}
|
.devcontainer with docker-compose
{
"name": "Docker Compose Example",
"dockerComposeFile": "docker-compose.yml",
"service": "service-to-start-in-vscode",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"settings": {},
"extensions": [
"ms-vscode.cpptools"
]
}
|
VS Code Command Palette (>remote-containers:...)
Reopen in Container |
Reopen Folder Locally |
Rebuild Container |
Rebuild Container Without Cache |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets