NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
Перейти к файлу
Chuck Lantz 58613fb46a README and CONTRIBUTING clarifications 2019-05-17 14:22:14 -07:00
.github/ISSUE_TEMPLATE Update bug_report.md 2019-03-28 09:48:44 -07:00
.vscode Removed docker cli from .devconatiner to speed up initial build time. Also added setting to ignore extension recommendations so that users aren't prompted to download the docker extension. 2019-04-15 21:18:22 +00:00
container-templates Add postCreateCommand example to templates 2019-05-09 16:48:32 -07:00
containers Merge pull request #46 from Shikanime/doc/fix-typo 2019-05-17 09:56:08 -07:00
repository-containers/github.com Make LICENSE a link so it can be clicked when used in projects 2019-04-25 14:06:21 -07:00
.editorconfig Fix tabs vs spaces 2019-05-08 16:49:43 -07:00
.gitattributes Drop array for postCreateCommand 2019-05-10 07:35:56 -07:00
.gitignore Include readmes (Microsoft/vscode-remote#1141) 2019-04-15 11:36:59 +02:00
CONTRIBUTING.md README and CONTRIBUTING clarifications 2019-05-17 14:22:14 -07:00
LICENSE Initial commit 2018-11-05 04:52:41 -08:00
README.md README and CONTRIBUTING clarifications 2019-05-17 14:22:14 -07:00
azure-pipelines.yml Yarn! (Microsoft/vscode-remote#1141) 2019-04-15 12:33:16 +02:00
package.json 0.15.0 2019-05-08 08:33:32 +02:00
yarn.lock Include readmes (Microsoft/vscode-remote#1141) 2019-04-15 11:36:59 +02:00

README.md

VS Code Remote Development Container Definitions

Visual Studio Code logo Visual Studio Code Remote Development
Open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set. Learn more!
Download now!

A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. The Remote - Containers extension in the Remote Development extension pack allows you to open any folder mounted into or inside a dev container and take advantage of VS Code's full development feature set.

This repository contains a set of dev container definitions to help get you up and running with a containerized environment. The definitions describe the appropriate container image, runtime arguments for starting the container, and VS Code extensions that should be installed. They are intended to be dropped into an existing project or folder rather than acting as sample projects. (See the vscode-remote-try-* repositories if you are looking for sample projects.)

Using a definition

To add a dev container definition in your project, you can either:

  • Add it using VS Code:

    1. If this is your first time creating a dev container, follow the getting started steps to configure your machine.
    2. Start VS Code and open your project folder.
    3. Press F1 and select either the Remote-Containers: Create Container Configuration File... or Remote-Containers: Reopen Folder in Container commands.
    4. Follow the directions and pick one of the existing development container definitions in this repository from the list.
  • Or manually copy the contents of one of the folders in the containers directory into your project. You should be able to copy just the .devcontainer folder and ignore everything else. See the definition's README for details.

Adding a definition to an existing repository

You can share a customized dev container definition for your project by adding the files under .devcontainer to source control. Anyone who then opens a local copy of your repo in VS Code will be prompted to reopen the folder in a container, provided they have the Remote Development extension pack installed.

Your team now has a consistent environment and tool-chain and new contributors or team members can be productive quickly. First-time contributors will require less guidance and there will be fewer issues related to environment setup.

Testing a definition

Some dev container definitions include test assets. To test a definition:

  1. If this is your first time creating a dev container, follow the getting started steps to configure your machine.
  2. Browse the contents of the containers folder in this repository and pick one. Review the README to see if there are any manual setup steps before continuing.
  3. Clone this repository locally.
  4. Start VS Code, press F1, and run the Remote-Containers: Open Folder in Container... command.
  5. Select the root of the definition folder from the cloned repository when prompted (not the test-project folder if present).
  6. See the definition's README for what to do next.

Sample projects

If you want to try a sample project which already has a dev container, check out one of the following repositories:

Contents

  • containers - Contains reusable dev container definitions.
  • container-templates - Contains templates for creating your own container definitions or to contribute back.
  • repository-containers - Dev container definitions for working public source code repositories.

Common Questions

Can I just reuse an existing container image or Docker / Docker Compose configuration?

Yes, if you want to use an existing Dockerfile as a starting point, run Remote-Containers: Create Container Configuration File... from the Command Palette (F1). You'll be prompted to select a Dockerfile or Docker Compose file and customize from there. If you prefer, you can also start up the container and attach to it.

What is the goal of devcontainer.json?

A devcontainer.json file is similar to launch.json for debugging, but designed to launch (or attach to) a development container instead. At its simplest, all you need is a .devcontainer/devcontainer.json file in your project that references an image, Dockerfile, or docker-compose.yml, and a few properties. You can adapt it for use in a wide variety of situations.

Contributing and feedback

Have a question or feedback?

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See LICENSE.