Visual Studio Code Remote - Containers
Note: You need Visual Studio Code Insiders to use this extension!
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 are 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.
Install 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.)
- 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 false 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.