Try agent mode in VS Code!
Dismiss this update
This article includes some of the common questions for getting the Dev Containers extension up and running in different environments.
No. A development container defines an environment in which you develop your application before you are ready to deploy. While deployment and development containers may resemble one another, you may not want to include tools in a deployment image that you use during development.
The devcontainers/templates repository includes a set of dev container definitions for some common development environments. You can also attach to a running container without setting up a dev container definition, if you prefer to use an alternate container build or deployment workflow.
No. The Buildpacks concept focuses on taking source code and generating deployable container images through a series of defined steps. A dev container is an environment in which you can develop your application before you are ready to build. They are therefore complementary concepts.
Right-click on the Docker task bar item. On Windows, select the Settings menu item then Resources > File Sharing and check the drive(s) where your source code is located. On macOS, select the Preferences menu item then Resources > File Sharing and make sure the folder containing your source code is under a file path specified in the list.
See Docker Desktop for Windows tips for information on workarounds to common Docker for Windows issues.
Some extensions rely on libraries not found in specific Docker images. For example, Visual Studio Live Share requires the installation of system-level dependencies, which are listed in their documentation. The need for these dependencies may depend on the operating system (for example, specific Linux distribution) used by your Docker image. You may need to install these dependencies during the Docker build process, by adding required commands to your Dockerfile. Search the specific extension's documentation to check for dependencies and see Installing additional software for help with resolving the problem.
A VS Code window can only connect to one window currently, but you can open a new window and attach to an already running container or use a common Docker Compose file with multiple devcontainer.json
files to automate the process a bit more.
Yes, see the sections on opening a folder on a remote SSH host or Remote Tunnels host in a container for information.
You can build images and deploy containers by forwarding the Docker socket and installing the Docker CLI (and kubectl for Kubernetes) in the container. See the Docker outside of Docker, Docker outside of Docker Compose, and Kubernetes-Helm dev container definitions for details.
Installation of VS Code Server requires that your local machine have outbound HTTPS (port 443) connectivity to:
update.code.visualstudio.com
vscode.blob.core.windows.net
*.vo.msecnd.net
(Azure CDN)The Dev Containers extensions will download VS Code Server locally and copy it to the container once connected.
You can install extensions manually without an internet connection using the Extensions: Install from VSIX... command, but if you use the extension panel or devcontainer.json
to install extensions, your local machine and VS Code Server will need outbound HTTPS (port 443) access to:
marketplace.visualstudio.com
*.vo.msecnd.net
(Azure CDN)*.gallerycdn.vsassets.io
(Azure CDN)Finally, some extensions (like C#) download secondary dependencies from download.microsoft.com
or download.visualstudio.microsoft.com
. Others (like Visual Studio Live Share) may have additional connectivity requirements. Consult the extension's documentation for details if you run into trouble.
VS Code Server runs on a random port inside the container and VS Code itself uses docker exec
to communicate with it over Docker's configured communication channel.
The VS Code extension API hides most of the implementation details of running remotely so many extensions will just work inside dev containers without any modification. However, we recommend that you test your extension in a dev container to be sure that all of its functionality works as expected. See the article on Supporting Remote Development for details.
The following articles may help answer your question:
As containerizing production workloads becomes commonplace, dev containers have become useful for scenarios beyond VS Code. We're creating the Development Container Specification to empower anyone in any tool to configure a consistent development environment. It seeks to find ways to enrich existing formats with common development specific settings, tools, and configurations while still providing a simplified, un-orchestrated single container option – so that they can be used as coding environments or for continuous integration and testing.
You can learn more and review the specification at containers.dev, and you can review active proposals and contribute to the specification in the devcontainers/spec repository on GitHub.