Visual Studio Code Remote - Containers
The Remote - Containers extension lets you use a Docker container as a full-featured development environment. Containers make a great development environment because you can:
- Develop with a consistent and easily reproducible toolchain and on the same operating system you are deploying to.
- Quickly swap between different, isolated development environments and safely make updates without worrying about impacting your local machine.
- Make it easy for new team members / contributors to get up and running in a consistent development environment.
The extension starts (or attaches to) a development container running a well defined tool and runtime stack. Workspace files can be mounted into the container from the local file system, or copied or cloned into it once the container is running. Extensions are installed and run inside the container where they have full access to the tools, platform, and file system.
You then work with VS Code as if everything were running locally on your machine, except now they are isolated inside a container.
Local: Docker Desktop 2.0+ for macOS/Windows 10 Pro/Enterprise or Docker CE/EE 18.06+ and Docker Compose 1.21+ for Linux. Docker Toolbox and Ubuntu snap packages are not supported. However, Docker does not need to be running if you are using a remote host. See the minimum requirements for VS Code for additional details.
Full support: x86_64 Debian 8+, Ubuntu 16.04+, CentOS / RHEL 7+ based containers.
Experimental support: x86_64 Alpine Linux containers in VS Code Insiders only.
glibc based Linux containers may work if they have needed prerequisites.
musl based Alpine Linux support is available in VS Code Insiders, some extensions installed in the container may not work due to
glibc dependencies in native code inside the extension. See the Remote Development and Linux article for details.
To get started, follow these steps:
Install VS Code or VS Code Insiders and this extension.
Install and configure Docker for your operating system.
Windows / macOS:
- Install Docker Desktop for Mac/Windows. (Docker Toolbox is not currently supported. However, Docker does not need to be running if you are using a remote host.)
- Right-click on the Docker task bar item and update Settings / Preferences > Shared Drives / File Sharing with any source code locations you want to open in a container. If you hit trouble, see here for tips on avoiding common problems with sharing.
- Windows: Consider adding a
.gitattributes file to your repos or disabling automatic line ending conversion for Git on the Windows side by using a command prompt to run:
git config --global core.autocrlf input If left enabled, this setting can cause files that you have not edited to appear modified due to line ending differences. See tips and tricks for details.
- Follow the Docker CE/EE install instructions for your distribution. The Ubuntu Snap package is not supported.
- Add your user to the
docker group by using a terminal to run:
sudo usermod -aG docker $USER Sign out and back in again so this setting takes effect.
Check out one of the following quick starts to get going:
Another way to learn what you can do with the extension is to browse the commands it provides. Press
F1 to bring up the Command Palette and type in
Remote-Containers for a full list of commands.
You can also click on the Remote "Quick Access" status bar item to get a list of the most common commands.
For more information, please see the extension documentation.
Questions, Feedback, Contributing
Have a question or feedback?
Or connect with the community...
Visual Studio Code Remote - Containers and related extensions collect telemetry data to help us build a better experience working remotely from VS Code. We only collect data on which commands are executed. We do not collect any information about image names, paths, etc. The extension respects the
telemetry.enableTelemetry setting which you can learn more about in the Visual Studio Code FAQ.
By downloading and using the Visual Studio Remote - Containers extension and its related components, you agree to the product license terms and privacy statement.