Visual Studio Code Remote - Containers
The Remote - Containers extension lets you use a Docker container as a full-featured development environment. Whether you deploy to containers or not, containers make a great development environment because you can:
- Develop with a consistent, easily reproducible toolchain on the same operating system you deploy 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.
- Try out new technologies or clone a copy of a code base without impacting your local setup.
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.
Containers: x86_64 Debian 8+, Ubuntu 16.04+, CentOS / RHEL 7+, Alpine Linux based containers.
glibc based Linux containers may work if they have needed prerequisites.
musl based Alpine Linux support is available, some extensions installed in the container may not work due to
glibc dependencies in native code inside the extension. See the Remote Development with Linux article for details.
Note that the Docker daemon/service does not need to be running locally if you are using a remote Docker host.
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.
- Right-click on the Docker task bar item and update Settings / Preferences > Shared Drives / File Sharing with any locations your source code is kept. See tips and tricks for troubleshooting.
- Follow the official install instructions for Docker CE/EE. If you use Docker Compose, follow the Docker Compose install directions.
- 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.
Working with Git? Here are two tips to consider:
- If you are working with the same repository folder in a container and Windows, be sure to set up consistent line endings. See tips and tricks to learn how.
- If you clone using a Git credential manager, your container should already have access to your credentials! If you use SSH keys, you can also opt-in to sharing them. See Sharing Git credentials with your container for details.
Follow the step-by-step tutorial or if you are comfortable with Docker, follow these four steps:
- Follow the installation steps above.
- Start VS Code
- Run the Remote-Containers: Open Folder in Container... command and select the local folder.
Check out the repository README for things to try. Next, learn how you can:
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.