Merge branch 'main' into alexbuckgit/docutune-autopr-cosmos-db-rebrand-20221012-234716-9550977
This commit is contained in:
Коммит
66bb6b097e
|
@ -0,0 +1,25 @@
|
|||
name: PR Chat
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, ready_for_review, closed]
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !github.event.pull_request.draft }}
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'microsoft/vscode-github-triage-actions'
|
||||
ref: stable
|
||||
path: ./actions
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: Run Code Review Chat
|
||||
uses: ./actions/code-review-chat
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
slack_token: ${{ secrets.SLACK_TOKEN }}
|
||||
slack_bot_name: 'VSCodeBot'
|
||||
notification_channel: codereview
|
|
@ -29,7 +29,7 @@ The VS Code APIs are designed to automatically run on the correct machine (eithe
|
|||
|
||||
## Debugging Extensions
|
||||
|
||||
While you [can install a development version of your extension](#installing-a-development-version-of-your-extension) in a remote environment for testing, if you encounter issues, you will likely want to debug your extension directly in a remote environment. In this section, we will cover how to edit, launch, and debug your extension in [GitHub Codespaces](#debugging-with-visual-studio-codespaces), a [local container](#debugging-in-a-custom-development-container), an [SSH host](#debugging-using-ssh), or in [WSL](#debugging-using-wsl).
|
||||
While you [can install a development version of your extension](#installing-a-development-version-of-your-extension) in a remote environment for testing, if you encounter issues, you will likely want to debug your extension directly in a remote environment. In this section, we will cover how to edit, launch, and debug your extension in [GitHub Codespaces](#debugging-with-github-codespaces), a [local container](#debugging-in-a-custom-development-container), an [SSH host](#debugging-using-ssh), or in [WSL](#debugging-using-wsl).
|
||||
|
||||
Typically, your best starting point for testing is to use a remote environment that restricts port access (for example Codespaces, a container, or remote SSH hosts with a restrictive firewall) since extensions that work in these environments tend to work in less restrictive ones like WSL.
|
||||
|
||||
|
@ -53,11 +53,11 @@ The extension development host window that appears will include your extension r
|
|||
|
||||
Follow these steps:
|
||||
|
||||
1. To use a development container locally, [install and configure the Dev Containers extension](/docs/remote/containers#_getting-started), and use **File > Open... / Open Folder...** to open your source code locally in VS Code. To use Codespaces instead, navigate to the repository that contains your extension on GitHub and [open it in a codespace](https://docs.github.com/github/developing-online-with-codespaces/creating-a-codespace) to work with it in a browser-based editor. You can also [open the codespace in VS Code](https://docs.github.com/en/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code) if you prefer.
|
||||
1. To use a development container locally, [install and configure the Dev Containers extension](/docs/devcontainers/containers#getting-started), and use **File > Open... / Open Folder...** to open your source code locally in VS Code. To use Codespaces instead, navigate to the repository that contains your extension on GitHub and [open it in a codespace](https://docs.github.com/github/developing-online-with-codespaces/creating-a-codespace) to work with it in a browser-based editor. You can also [open the codespace in VS Code](https://docs.github.com/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code) if you prefer.
|
||||
|
||||
2. Select **Dev Containers: Add Dev Container Configuration Files...** or **Codespaces: Add Dev Container Configuration Files...** from the Command Palette (`kbstyle(F1)`), and pick **Node.js & TypeScript** (or Node.js if you are not using TypeScript) to add the needed container configuration files.
|
||||
|
||||
3. **Optional:** After this command runs, you can modify the contents of the `.devcontainer` folder to include additional build or runtime requirements. See the in-depth [Dev Containers](/docs/remote/create-dev-container#_set-up-a-folder-to-run-in-a-container) documentation for details.
|
||||
3. **Optional:** After this command runs, you can modify the contents of the `.devcontainer` folder to include additional build or runtime requirements. See the in-depth [Create a Dev Container](/docs/devcontainers/create-dev-container) documentation for details.
|
||||
|
||||
4. Run **Dev Containers: Reopen in Container** or **Codespaces: Add Dev Container Configuration Files...** and in a moment, VS Code will set up the container and connect. You will now be able to develop your source code from inside the container just as you would in the local case.
|
||||
|
||||
|
@ -73,7 +73,7 @@ The extension development host window that appears will include your extension r
|
|||
|
||||
Follow steps:
|
||||
|
||||
1. After [installing and configuring the Remote - SSH extension](/docs/remote/ssh#_getting-started), select **Remote-SSH: Connect to Host...** from the Command Palette (`kbstyle(F1)`) in VS Code to connect to a host.
|
||||
1. After [installing and configuring the Remote - SSH extension](/docs/remote/ssh#getting-started), select **Remote-SSH: Connect to Host...** from the Command Palette (`kbstyle(F1)`) in VS Code to connect to a host.
|
||||
|
||||
2. Once connected, either use **File > Open... / Open Folder...** to select the remote folder with your extension source code in it or select **Git: Clone** from the Command Palette (`kbstyle(F1)`) to clone it and open it on the remote host.
|
||||
|
||||
|
@ -113,7 +113,7 @@ Follow these steps:
|
|||
|
||||
1. If this is a published extension, you may want to add `"extensions.autoUpdate": false` to `settings.json` to prevent it from auto-updating to the latest Marketplace version.
|
||||
2. Next, use `vsce package` to package your extension as a VSIX.
|
||||
3. Connect to a [codespace](https://docs.github.com/github/developing-online-with-codespaces), [development container](/docs/remote/containers), [SSH host](/docs/remote/ssh), or [WSL environment](/docs/remote/wsl).
|
||||
3. Connect to a [codespace](https://docs.github.com/github/developing-online-with-codespaces), [Dev Containers](/docs/devcontainers/containers), [SSH host](/docs/remote/ssh), or [WSL environment](/docs/remote/wsl).
|
||||
4. Use the **Install from VSIX...** command available in the Extensions view **More Actions** (`...`) menu to install the extension in this specific window (not a local one).
|
||||
5. Reload when prompted.
|
||||
|
||||
|
@ -604,7 +604,7 @@ There are a few extension problems that could be resolved with some added functi
|
|||
|
||||
| Problem | Description |
|
||||
|---------|-------------|
|
||||
| **Cannot access attached devices from Workspace extension** | Extensions that access locally attached devices will be unable to connect to them when running remotely. We are investigating the best approach to solve this problem. |
|
||||
| **Cannot access attached devices from Workspace extension** | Extensions that access locally attached devices will be unable to connect to them when running remotely. One approach to overcome this is to create a companion UI extension whose job is to access the attached device and offers commands that the remote extension can invoke too. <br> Another approach is reverse tunneling, which is being tracked in a [VS Code repo issue](https://github.com/microsoft/vscode/issues/100222). |
|
||||
|
||||
## Questions and feedback
|
||||
|
||||
|
|
|
@ -239,6 +239,24 @@ Eligible domains meet the following criteria:
|
|||
- Your domain must use HTTPS protocol.
|
||||
- Your domain must be able to serve an HTTP 200 status response to a HEAD request.
|
||||
|
||||
### Extension pricing label
|
||||
|
||||
You can add a pricing label to your extension in the Marketplace to indicate that it is `FREE` or `FREE TRIAL`.
|
||||
|
||||
As an extension author, you can opt-in to display a pricing label on your extension page by adding the `pricing` field to your `package.json`, for example:
|
||||
|
||||
```json
|
||||
{
|
||||
"pricing": "Free"
|
||||
}
|
||||
```
|
||||
|
||||
The value of the `pricing` field can be either `Free` or `Trial`. Note that these values are case-sensitive.
|
||||
|
||||
If you do not add the `pricing` field to your `package.json`, the default label will be `FREE`.
|
||||
|
||||
>**Note:** Make sure to use the `vsce` version >= `2.10.0` when publishing your extension for the pricing label to work.
|
||||
|
||||
### Extension Sponsor
|
||||
|
||||
An extension can opt-in to sponsorship by adding a `sponsor` field in its `package.json`, with the `url` field for the sponsorship link the extension author would like to use. For example:
|
||||
|
|
|
@ -102,7 +102,7 @@ For more information, please see the [Developing using SSH](https://aka.ms/vscod
|
|||
|
||||
---
|
||||
|
||||
The **[Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)** extension lets you use a [Docker container](https://docker.com) as your [development container](https://aka.ms/vscode-remote/containers/folder-setup). Containers make great development environments because:
|
||||
The [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension lets you use a [Docker container](https://docker.com) as your [development container](https://aka.ms/vscode-remote/containers/folder-setup). Containers make great development environments because:
|
||||
|
||||
* You can develop with a consistent and easily reproducible tool chain, on the same operating system you are deploying to.
|
||||
* Containers are isolated, meaning you can quickly swap between different development environments without impacting your local machine.
|
||||
|
|
|
@ -44,7 +44,7 @@ In this blog post, we'll use a Windows client and target a Linux VM on Azure.
|
|||
|
||||
To get started, you need to have done the following:
|
||||
|
||||
1. Install an [OpenSSH compatible SSH client](https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client) (PuTTY is not supported).
|
||||
1. Install an [OpenSSH compatible SSH client](/docs/remote/troubleshooting.md#installing-a-supported-ssh-client) (PuTTY is not supported).
|
||||
2. Install [Visual Studio Code](https://code.visualstudio.com).
|
||||
3. Have an Azure subscription (If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin).
|
||||
|
||||
|
@ -54,13 +54,13 @@ If you don't have an existing Linux virtual machine, you can create a new VM thr
|
|||
|
||||
![Create a virtual machine](create-vm.png)
|
||||
|
||||
Now you can specify details of your VM, such as the name, the size of, and the base image. We will choose Ubuntu Server 18.04 LTS for this example, but you can choose recent versions of other Linux distros and look at our [supported SSH servers](https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-server).
|
||||
Now you can specify details of your VM, such as the name, the size of, and the base image. We will choose Ubuntu Server 18.04 LTS for this example, but you can choose recent versions of other Linux distros and look at our [supported SSH servers](/docs/remote/troubleshooting.md#installing-a-supported-ssh-server).
|
||||
|
||||
![Virtual machine instance details](vm-instance-details.png)
|
||||
|
||||
## Set up SSH
|
||||
|
||||
There are several authentication methods into a VM, including an SSH public/private key pair or a username and password. We strongly recommend using key-based authentication so you do not need to enter your password each time you connect. If you're on Windows and have already created keys using PuttyGen, you can [reuse them](https://code.visualstudio.com/docs/remote/troubleshooting#_reusing-a-key-generated-in-puttygen).
|
||||
There are several authentication methods into a VM, including an SSH public/private key pair or a username and password. We strongly recommend using key-based authentication so you do not need to enter your password each time you connect. If you're on Windows and have already created keys using PuttyGen, you can [reuse them](/docs/remote/troubleshooting.md#reusing-a-key-generated-in-puttygen).
|
||||
|
||||
If you don't have an SSH key pair, open a bash shell or the command line and type in:
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ This technique allows you to inspect the container environment via the command l
|
|||
|
||||
In this post, we'll look at how you can attach Visual Studio Code to your container so that you can use the full power of VS Code, including debugging, to inspect the container, figure out what is going wrong, and fix it.
|
||||
|
||||
The [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), which launched in May of this year, allows you to connect your local VS Code to a container host while maintaining all of your personalized settings, themes, and key bindings.
|
||||
The [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension, which launched in May of this year, allows you to connect your local VS Code to a container host while maintaining all of your personalized settings, themes, and key bindings.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
This blog post presumes you have [Docker Desktop](https://www.docker.com/products/docker-desktop) and [Visual Studio Code](https://code.visualstudio.com/download) installed. You will also need the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers). To install the Dev Containers extension, open the Extensions view (`kb(workbench.view.extensions)`), search for "Dev Containers", select **Install**, and restart VS Code if prompted.
|
||||
This blog post presumes you have [Docker Desktop](https://www.docker.com/products/docker-desktop) and [Visual Studio Code](https://code.visualstudio.com/download) installed. You will also need the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. To install the Dev Containers extension, open the Extensions view (`kb(workbench.view.extensions)`), search for "Dev Containers", select **Install**, and restart VS Code if prompted.
|
||||
|
||||
## The application
|
||||
|
||||
|
@ -157,9 +157,9 @@ Now you're ready to spin up another container and work on another project!
|
|||
|
||||
In this blog post, we covered how you can use the Dev Containers extension to attach to your existing containerized applications.
|
||||
|
||||
You can also create a [devcontainer.json](https://code.visualstudio.com/docs/remote/containers#_creating-a-devcontainerjson-file), which describes the development environment you want to create or attach to and lives with your project to share with your team members.
|
||||
You can also create a [devcontainer.json](/docs/devcontainers/containers.md#create-a-devcontainerjson-file), which describes the development environment you want to create or attach to and lives with your project to share with your team members.
|
||||
|
||||
Other useful resources include the full [Developing inside a Container](https://code.visualstudio.com/docs/remote/containers) documentation, [Advanced container configuration](https://code.visualstudio.com/remote/advancedcontainers/overview), and our [Introductory tutorial](https://code.visualstudio.com/docs/remote/containers-tutorial) on building isolated development environments with the Dev Containers extension.
|
||||
Other useful resources include the full [Developing inside a Container](/docs/devcontainers/containers.md) documentation, [Advanced container configuration](/remote/advancedcontainers/overview.md), and our [Introductory tutorial](/docs/devcontainers/tutorial.md) on building isolated development environments with the Dev Containers extension.
|
||||
|
||||
Happy Remote Coding,
|
||||
|
||||
|
|
|
@ -77,11 +77,11 @@ Installing the WSL extension added the Remote Explorer to VS Code. When we look
|
|||
|
||||
## Working with containers
|
||||
|
||||
We can leverage the [Dev Containers](https://code.visualstudio.com/docs/remote/containers) extension to view and attach to containers, in addition to a variety of other scenarios, such as:
|
||||
We can leverage the [Dev Containers](/docs/devcontainers/containers.md) extension to view and attach to containers, in addition to a variety of other scenarios, such as:
|
||||
|
||||
* [Developing within a set of sample containers](https://code.visualstudio.com/docs/remote/containers-tutorial)
|
||||
* [Opening existing source code in a container](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-an-existing-folder-in-a-container)
|
||||
* [Working with a GitHub repository](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) in an isolated container volume.
|
||||
* [Developing within a set of sample containers](/docs/devcontainers/tutorial.md)
|
||||
* [Opening existing source code in a container](/docs/devcontainers/containers.md#quick-start-open-an-existing-folder-in-a-container)
|
||||
* [Working with a GitHub repository](/docs/devcontainers/containers.md#quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) in an isolated container volume.
|
||||
|
||||
These configurations allow you to easily recreate the same development environment across machines, install tools and extensions specific to a project into a DevContainer, and develop in a setup similar to the environment for deployment, leaving the local machine unchanged. We can also view and attach to containers using the [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) extension.
|
||||
|
||||
|
|
|
@ -30,13 +30,13 @@ Dev containers provide a separate coding environment from your computer. For exa
|
|||
|
||||
As an instructor, you can create a specific image for an assignment. Each student will get the exact same version of dependencies, such as the same version of Python or a C++ compiler, regardless of their operating system or any other files already installed on their computer.
|
||||
|
||||
## Developement Containers in VS Code
|
||||
## Development Containers in VS Code
|
||||
|
||||
The Visual Studio Code [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension lets you use a container as your main coding environment. In the classroom, an instructor can take an [existing dev container](https://github.com/microsoft/vscode-dev-containers/tree/main/containers), or create their own, and share it with the class. Each student can open the container in VS Code and automatically have the tools and runtimes they need to develop their applications. Students will also have access to VS Code's full feature set, including IntelliSense and debugging, while coding.
|
||||
|
||||
The Remote – Containers extension works solely with Linux-based containers, so although students may have different operating systems on their computers, the coding environment will be consistent across all of them.
|
||||
The Dev Containers extension works solely with Linux-based containers, so although students may have different operating systems on their computers, the coding environment will be consistent across all of them.
|
||||
|
||||
We've already seen instructors using Remote – Containers in their classrooms with success. You can check out [Using DevContainers to Standardize Student Development Environments: An Experience Report](https://dl.acm.org/doi/pdf/10.1145/3341525.3387424) to learn more about the experiences of three researchers who used dev containers in a course at UC San Diego.
|
||||
We've already seen instructors using Dev Containers in their classrooms with success. You can check out [Using DevContainers to Standardize Student Development Environments: An Experience Report](https://dl.acm.org/doi/pdf/10.1145/3341525.3387424) to learn more about the experiences of three researchers who used dev containers in a course at UC San Diego.
|
||||
|
||||
This post will serve as a guide to instructors looking to implement development containers in the classroom to create a smoother, more consistent environment for their students.
|
||||
|
||||
|
@ -116,7 +116,7 @@ We can run our program with **F5**. Notice that the program stops once it hits t
|
|||
|
||||
### Creating a container for your class
|
||||
|
||||
Now that we've seen a fantastic example of a container, let's set up our first container ourselves using the Remote – Containers extension. Let's start off in a "Hello World" Python application:
|
||||
Now that we've seen a fantastic example of a container, let's set up our first container ourselves using the Dev Containers extension. Let's start off in a "Hello World" Python application:
|
||||
|
||||
![Hello world Python app](14-helloworld-cropped.png)
|
||||
|
||||
|
@ -132,7 +132,7 @@ The Dev Containers extension automatically adds a `.devcontainer` folder and two
|
|||
|
||||
#### devcontainer.json
|
||||
|
||||
[`devcontainer.json`](https://code.visualstudio.com/docs/remote/containers#_creating-a-devcontainerjson-file) describes how VS Code should start our container and what to do after it connects. This file can be located under `.devcontainer/devcontainer.json` or stored directly as `devcontainer.json` in the root of a project.
|
||||
[`devcontainer.json`](/docs/devcontainers/containers.md#create-a-devcontainerjson-file) describes how VS Code should start our container and what to do after it connects. This file can be located under `.devcontainer/devcontainer.json` or stored directly as `devcontainer.json` in the root of a project.
|
||||
|
||||
Here is a simple example of a `devcontainer.json`. It pulls a preconfigured Node image, automatically sets up port forwarding for port 3000, and will install the eslint extension when the container is created:
|
||||
|
||||
|
@ -210,7 +210,7 @@ To see how students can access the dev container from GitHub and begin programmi
|
|||
|
||||
## Feedback & further resources
|
||||
|
||||
To help set up VS Code with containers, we have detailed articles on the VS Code [Remote Development documentation](https://code.visualstudio.com/docs/remote/containers). If you have any questions or feedback for our team, please feel free to open an issue on the VS Code [Remote Development GitHub Repository](https://github.com/microsoft/vscode-remote-release/issues) or Tweet us [@code](https://twitter.com/code).
|
||||
To help set up VS Code with containers, we have detailed articles on the VS Code [Remote Development documentation](/docs/devcontainers/containers.md). If you have any questions or feedback for our team, please feel free to open an issue on the VS Code [Remote Development GitHub Repository](https://github.com/microsoft/vscode-remote-release/issues) or Tweet us [@code](https://twitter.com/code).
|
||||
|
||||
Happy Coding!
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ Click the remote indicator in the lower left, then select **Continue Working on.
|
|||
You'll be presented with three options:
|
||||
|
||||
* **Clone Repository Locally**: Clone the current repo to your local machine. A local file explorer will pop up, allowing you to select a location on disk to clone the remote repo.
|
||||
* **Clone Repository in Container Volume**: Clone the current repo in a Docker [container volume](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) using the Remote – Containers extension (you'll need the [Remote – Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension and Docker installed). VS Code will reload and connect using Remote – Containers, and the remote indicator will now read **Dev Container: {image name}**.
|
||||
* **Clone Repository in Container Volume**: Clone the current repo in a Docker [container volume](/docs/devcontainers/containers.md#quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) using the Dev Containers extension (you'll need the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension and Docker installed). VS Code will reload and connect using Dev Containers, and the remote indicator will now read **Dev Container: {image name}**.
|
||||
* **Open in Codespaces**: Continue your work in a [GitHub Codespace](https://github.com/features/codespaces). When you select this option, a browser will open and direct you to your list of Codespaces for this repository.
|
||||
|
||||
![VS Code Command Palette with options to continue locally, in a volume, or in Codespaces](continue-options.png)
|
||||
|
|
|
@ -55,7 +55,7 @@ This brings us to the concept of a development container: a container that runs
|
|||
|
||||
![A diagram showing containers with different tech stacks](container-diagram.png)
|
||||
|
||||
To provide a way to create and connect to dev containers, VS Code released the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in 2019. This extension enhances local development by using the full power of dev containers, all while never leaving the comfort of VS Code. With over 11 million installs of the extension, it got us thinking: what if you could have a dev container that is hosted in the cloud?
|
||||
To provide a way to create and connect to dev containers, VS Code released the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension in 2019. This extension enhances local development by using the full power of dev containers, all while never leaving the comfort of VS Code. With over 11 million installs of the extension, it got us thinking: what if you could have a dev container that is hosted in the cloud?
|
||||
|
||||
## Moving to the cloud
|
||||
|
||||
|
@ -87,7 +87,7 @@ With the power of VS Code, GitHub, and dev containers, GitHub Codespaces provide
|
|||
|
||||
## What's next?
|
||||
|
||||
As developers, we want to spend more time developing software and less time on headache-inducing configuration. Trends in the industry can, and should, be used to empower developers to increase their productivity. We've explored how containers and the cloud can take us to the next level, and you can [get started with the Dev Containers extension](https://code.visualstudio.com/docs/remote/containers) to see for yourself. Now, what do you think could be the next step in making our lives even easier?
|
||||
As developers, we want to spend more time developing software and less time on headache-inducing configuration. Trends in the industry can, and should, be used to empower developers to increase their productivity. We've explored how containers and the cloud can take us to the next level, and you can [get started with Dev Containers](/docs/devcontainers/containers.md) to see for yourself. Now, what do you think could be the next step in making our lives even easier?
|
||||
|
||||
Happy Coding!
|
||||
|
||||
|
|
|
@ -51,11 +51,11 @@ The example below installs the [go](https://github.com/devcontainers/features/tr
|
|||
}
|
||||
```
|
||||
|
||||
You can also explore official and publicly contributed Features [on the specification site](https://containers.dev/features). Any Feature can be added by editing `devcontainer.json`, and publicly published ones can be added through existing dev container configuration experiences (such as available in the VS Code [Dev Containers](https://code.visualstudio.com/docs/remote/containers#_dev-container-features-preview) extension).
|
||||
You can also explore official and publicly contributed Features [on the specification site](https://containers.dev/features). Any Feature can be added by editing `devcontainer.json`, and publicly published ones can be added through existing dev container configuration experiences (such as available in the VS Code [Dev Containers](/docs/devcontainers/containers.md#dev-container-features-preview) extension).
|
||||
|
||||
![Specification site list of available Features](features-list-site.png)
|
||||
|
||||
You can even use dev containers with Features from your favorite CI system using the [dev container CLI](https://github.com/devcontainers/cli), a GitHub Action, or an Azure DevOps task. We have a GitHub Action and Azure DevOps task available in the [devcontainers/ci](https://github.com/devcontainers/ci) repository. The dev container CLI, GitHub Action, or Azure DevOps task can also be used to [pre-build images](https://code.visualstudio.com/docs/remote/devcontainer-cli#_prebuilding) that include Feature contents to speed up start times.
|
||||
You can even use dev containers with Features from your favorite CI system using the [dev container CLI](https://github.com/devcontainers/cli), a GitHub Action, or an Azure DevOps task. We have a GitHub Action and Azure DevOps task available in the [devcontainers/ci](https://github.com/devcontainers/ci) repository. The dev container CLI, GitHub Action, or Azure DevOps task can also be used to [pre-build images](/docs/devcontainers/devcontainer-cli.md#prebuilding) that include Feature contents to speed up start times.
|
||||
|
||||
If you'd like to not only use publicly available Features but also create your own private or public ones to share, continue reading!
|
||||
|
||||
|
|
|
@ -485,6 +485,11 @@
|
|||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/nodejs/nodejs-deployment</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/nodejs/reactjs-tutorial</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
|
@ -815,11 +820,6 @@
|
|||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/containers</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/codespaces</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
|
@ -840,11 +840,6 @@
|
|||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/containers-tutorial</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/wsl-tutorial</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
|
@ -855,18 +850,38 @@
|
|||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/devcontainer-cli</loc>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/containers</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/attach-container</loc>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/tutorial</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/remote/create-dev-container</loc>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/devcontainer-cli</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/attach-container</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/create-dev-container</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/tips-and-tricks</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://code.visualstudio.com/docs/devcontainers/faq</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
|
|
|
@ -15,14 +15,14 @@ Whether your workflow is through the [Azure CLI](https://learn.microsoft.com/cli
|
|||
|
||||
## Deployment tutorials
|
||||
|
||||
These tutorials from Microsoft Learn describe different ways of creating and deploying apps to Azure via Visual Studio Code:
|
||||
The tutorials and topics below describe different ways of creating and deploying apps to Azure via Visual Studio Code:
|
||||
|
||||
Tutorial | Description
|
||||
--- | ---
|
||||
[Deploy Azure Functions](https://learn.microsoft.com/azure/developer/javascript/tutorial/azure-function-cosmos-db-mongo-api) | Build and manage Azure Functions serverless apps directly in VS Code with the Azure Functions extension.
|
||||
[Deploy using the App Service extension](https://learn.microsoft.com/azure/app-service/tutorial-nodejs-mongodb-app) | Manage Azure resources directly in VS Code with the Azure App Service extension.
|
||||
[Deploy using Docker](https://learn.microsoft.com/azure/developer/javascript/tutorial/tutorial-vscode-docker-node/tutorial-vscode-docker-node-01) | Deploy your website using a Docker container.
|
||||
[Deploy a static website](https://learn.microsoft.com/azure/static-web-apps/getting-started) | Create, deploy, and update a static website.
|
||||
Tutorial(s) | Description | Framework / Language
|
||||
--- | --- | ---
|
||||
[Deploy a static website](https://learn.microsoft.com/azure/static-web-apps/getting-started) | Create, deploy, and update a static website | Angular, Blazor, React, or Vue
|
||||
[Deploy Node.js apps](/docs/nodejs/nodejs-deployment.md) | Deploy web apps, containerized apps, or serverless code | Node.js
|
||||
[Deploy Python apps](/docs/python/python-on-azure.md) | Deploy web apps, containerized apps, or serverless code | Python
|
||||
[Deploy Java apps](/docs/java/java-on-azure.md) | Deploy web apps, Spring Boot apps, or serverless code | Java
|
||||
|
||||
You can find additional tutorials and walkthroughs on the
|
||||
[Azure Developer Center](https://learn.microsoft.com/azure/developer), including language-specific articles for JavaScript and Node.js, Python, Java, and .NET.
|
||||
|
|
|
@ -22,7 +22,7 @@ The second important choice is whether to debug your service running as an ordin
|
|||
- Using the same OS for development and inside the service container.
|
||||
- Installing necessary tools and dependencies on top of your local environment.
|
||||
|
||||
1. Consider using a [development container](/docs/remote/containers.md) first, if you need a remote environment.
|
||||
1. Consider using a [development container](/docs/devcontainers/containers.md) first, if you need a remote environment.
|
||||
|
||||
- On Windows, using [Windows Subsystem for Linux (WSL)](#windows-subsystem-for-linux) is good option.
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ MetaDescription: Connect via SSH to Docker engine running on a remote machine an
|
|||
---
|
||||
# Connect to remote Docker over SSH
|
||||
|
||||
We recommend using the Visual Studio Code [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension to connect to a remote machine running Docker engine. You can use the [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) and [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extensions together. You may review the steps in the [remote development documentation](/docs/remote/containers.md#open-a-folder-on-a-remote-ssh-host-in-a-container).
|
||||
We recommend using the Visual Studio Code [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension to connect to a remote machine running Docker engine. You can use the [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) and [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extensions together. You may review the steps in the [Dev Containers documentation](/docs/devcontainers/containers.md#open-a-folder-on-a-remote-ssh-host-in-a-container).
|
||||
|
||||
It is also possible to connect to the remote Docker engine directly using SSH tunneling, which you can read more about below.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
Order: 10
|
||||
Area: remote
|
||||
Area: devcontainers
|
||||
TOCTitle: Attach to Container
|
||||
PageTitle: Attach to a running container using Visual Studio Code Remote Development
|
||||
ContentId: ed14ef07-f44c-4675-b95b-cb5faffc7abb
|
||||
|
@ -15,13 +15,13 @@ Visual Studio Code can create and start containers for you but that may not matc
|
|||
|
||||
To attach to a Docker container, either select **Dev Containers: Attach to Running Container...** from the Command Palette (`kbstyle(F1)`) or use the **Remote Explorer** in the Activity Bar and from the **Containers** view, select the **Attach to Container** inline action on the container you want to connect to.
|
||||
|
||||
![Containers Explorer screenshot](images/containers/containers-attach.png)
|
||||
![Containers Explorer screenshot](images/attach-container/containers-attach.png)
|
||||
|
||||
> **Note:** When using Alpine Linux containers, some extensions may not work due to `glibc` dependencies in native code inside the extension.
|
||||
|
||||
## Attached container configuration files
|
||||
|
||||
VS Code supports image or container name-level configuration files to speed up setup when you repeatedly connect to a given Docker container. Once attached, anytime you open a folder, [install an extension](/docs/remote/containers.md#managing-extensions), or [forward a port](/docs/remote/containers.md#forwarding-or-publishing-a-port), a local image-specific configuration file will automatically be updated to remember your settings so that when you attach again, everything is back to the right place.
|
||||
VS Code supports image or container name-level configuration files to speed up setup when you repeatedly connect to a given Docker container. Once attached, anytime you open a folder, [install an extension](/docs/devcontainers/containers.md#managing-extensions), or [forward a port](/docs/devcontainers/containers.md#forwarding-or-publishing-a-port), a local image-specific configuration file will automatically be updated to remember your settings so that when you attach again, everything is back to the right place.
|
||||
|
||||
* By default, an **image-level** configuration is used. To view or update it after attaching, select **Dev Containers: Open Container Configuration File** from the Command Palette (`kbstyle(F1)`).
|
||||
|
||||
|
@ -61,7 +61,7 @@ Once saved, whenever you open a container for the first time with the same image
|
|||
|
||||
> **Tip:** If something is wrong with your configuration, you can also edit it when not attached to the container by selecting **Dev Containers: Open Attached Container Configuration File...** from the Command Palette (`kbstyle(F1)`) and then picking the image / container name from the presented list.
|
||||
|
||||
Finally, if you have extensions you want installed regardless of the container you attach to, you can update `settings.json` to specify a list of [extensions that should always be installed](/docs/remote/containers.md#always-installed-extensions).
|
||||
Finally, if you have extensions you want installed regardless of the container you attach to, you can update `settings.json` to specify a list of [extensions that should always be installed](/docs/devcontainers/containers.md#always-installed-extensions).
|
||||
|
||||
## Attached container configuration reference
|
||||
|
||||
|
@ -94,10 +94,10 @@ To attach to a container in a Kubernetes cluster, first install the [Kubernetes
|
|||
|
||||
> **Note:** Attached container configuration files are not yet supported for containers in a Kubernetes cluster.
|
||||
|
||||
![Attach to Kubernetes Container](images/containers/k8s-attach.png)
|
||||
![Attach to Kubernetes Container](images/attach-container/k8s-attach.png)
|
||||
|
||||
## Next steps
|
||||
|
||||
* [Create a Development Container](/docs/remote/create-dev-container.md) - Create a custom container for your work environment.
|
||||
* [Create a Dev Container](/docs/devcontainers/create-dev-container.md) - Create a custom container for your work environment.
|
||||
* [Advanced Containers](/remote/advancedcontainers/overview.md) - Find solutions to advanced container scenarios.
|
||||
* [devcontainer.json reference](https://containers.dev/implementors/json_reference) - Review the `devcontainer.json` schema.
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
Order: 12
|
||||
Area: remote
|
||||
Area: devcontainers
|
||||
TOCTitle: Advanced Containers
|
||||
PageTitle: Advanced Container Configuration
|
||||
ContentId: f180ac25-1d59-47ec-bad2-3ccbf214bbd8
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
Order: 3
|
||||
Area: remote
|
||||
TOCTitle: Containers
|
||||
Area: devcontainers
|
||||
TOCTitle: Overview
|
||||
PageTitle: Developing inside a Container using Visual Studio Code Remote Development
|
||||
ContentId: 7ec8a02b-2eb7-45c1-bb16-ddeaac694ff6
|
||||
MetaDescription: Developing inside a Container using Visual Studio Code Remote Development
|
||||
|
@ -19,7 +19,7 @@ This lets VS Code provide a **local-quality development experience** including f
|
|||
|
||||
## Getting started
|
||||
|
||||
**Note**: After reviewing this topic, you can get started with the introductory [Containers tutorial](/docs/remote/containers-tutorial.md).
|
||||
**Note**: After reviewing this topic, you can get started with the introductory [Containers tutorial](/docs/devcontainers/tutorial.md).
|
||||
|
||||
### System requirements
|
||||
|
||||
|
@ -30,7 +30,7 @@ This lets VS Code provide a **local-quality development experience** including f
|
|||
* **Linux**: [Docker CE/EE](https://docs.docker.com/install/#supported-platforms) 18.06+ and [Docker Compose](https://docs.docker.com/compose/install) 1.21+. (The Ubuntu snap package is not supported.)
|
||||
* **Remote hosts:** 1 GB RAM is required, but at least 2 GB RAM and a 2-core CPU is recommended.
|
||||
|
||||
Other [Docker compliant CLIs](/remote/advancedcontainers/docker-options.md) may work, but are not officially supported. Note that [attaching to a Kubernetes cluster](/docs/remote/attach-container.md#attach-to-a-container-in-a-kubernetes-cluster) only requires a properly configured [`kubectl` CLI](https://kubernetes.io/docs/reference/kubectl/overview/).
|
||||
Other [Docker compliant CLIs](/remote/advancedcontainers/docker-options.md) may work, but are not officially supported. Note that [attaching to a Kubernetes cluster](/docs/devcontainers/attach-container.md#attach-to-a-container-in-a-kubernetes-cluster) only requires a properly configured [`kubectl` CLI](https://kubernetes.io/docs/reference/kubectl/overview/).
|
||||
|
||||
**Containers**:
|
||||
|
||||
|
@ -51,7 +51,7 @@ To get started, follow these steps:
|
|||
|
||||
2. If you are using WSL 2 on Windows, to ensure the [WSL 2 back-end](https://aka.ms/vscode-remote/containers/docker-wsl2) is enabled: Right-click on the Docker taskbar item and select **Settings**. Check **Use the WSL 2 based engine** and verify your distribution is enabled under **Resources > WSL Integration**.
|
||||
|
||||
3. When not using the WSL 2 back-end, right-click on the Docker task bar item, select **Settings** and update **Resources > File Sharing** with any locations your source code is kept. See [tips and tricks](/docs/remote/troubleshooting.md#container-tips) for troubleshooting.
|
||||
3. When not using the WSL 2 back-end, right-click on the Docker task bar item, select **Settings** and update **Resources > File Sharing** with any locations your source code is kept. See [tips and tricks](/docs/devcontainers/tips-and-tricks.md) for troubleshooting.
|
||||
|
||||
**Linux**:
|
||||
|
||||
|
@ -69,23 +69,23 @@ To get started, follow these steps:
|
|||
|
||||
Here are two tips to consider:
|
||||
|
||||
* If you are working with the same repository both locally in Windows and inside a container, be sure to set up consistent line endings. See [tips and tricks](/docs/remote/troubleshooting.md#resolving-git-line-ending-issues-in-containers-resulting-in-many-modified-files) for details.
|
||||
* If you are working with the same repository both locally in Windows and inside a container, be sure to set up consistent line endings. See [tips and tricks](/docs/remote/troubleshooting.md#resolving-git-line-ending-issues-in-wsl-resulting-in-many-modified-files) for details.
|
||||
* 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](#sharing-git-credentials-with-your-container) for details.
|
||||
|
||||
### Working with Containers
|
||||
|
||||
The Dev Containers extension supports two primary operating models:
|
||||
|
||||
* You can use a container as your [full-time development environment](/docs/remote/create-dev-container.md#create-a-devcontainerjson-file).
|
||||
* You can [attach to a running container](/docs/remote/attach-container.md) to inspect it.
|
||||
* You can use a container as your [full-time development environment](/docs/devcontainers/create-dev-container.md#create-a-devcontainerjson-file).
|
||||
* You can [attach to a running container](/docs/devcontainers/attach-container.md) to inspect it.
|
||||
|
||||
## Quick start: Try a development container
|
||||
|
||||
The easiest way to get started is to try one of the sample development containers. The [Containers tutorial](/docs/remote/containers-tutorial.md) will walk you through setting up Docker and the Dev Containers extension and let you select a sample:
|
||||
The easiest way to get started is to try one of the sample development containers. The [Containers tutorial](/docs/devcontainers/tutorial.md) will walk you through setting up Docker and the Dev Containers extension and let you select a sample:
|
||||
|
||||
![Select a sample from the list](images/containers/select-a-sample.png)
|
||||
|
||||
> Note: If you already have VS Code and Docker installed, then you may use [open in dev container](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode-remote-try-python). You can learn more about this and how to add it to your repos in the [create a dev container guide](/docs/remote/create-dev-container.md#add-configuration-files-to-a-repository).
|
||||
> Note: If you already have VS Code and Docker installed, then you may use [open in dev container](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode-remote-try-python). You can learn more about this and how to add it to your repos in the [create a dev container guide](/docs/devcontainers/create-dev-container.md#add-configuration-files-to-a-repository).
|
||||
|
||||
## Quick start: Open an existing folder in a container
|
||||
|
||||
|
@ -95,7 +95,7 @@ This quick start covers how to set up a dev container for an existing project to
|
|||
|
||||
> **Tip:** If you want to edit the container's contents or settings before opening the folder, you can run **Dev Containers: Add Dev Container Configuration Files...** instead.
|
||||
|
||||
![Quick actions Status bar item](images/common/remote-dev-status-bar.png)
|
||||
![Quick actions Status bar item](images/containers/remote-dev-status-bar.png)
|
||||
|
||||
2. Now pick a starting point for your dev container. You can either select a base **dev container definition** from a filterable list, or use an existing [Dockerfile](https://docs.docker.com/engine/reference/builder/) or [Docker Compose file](https://docs.docker.com/compose/compose-file/#compose-file-structure-and-examples) if one exists in the folder you selected.
|
||||
|
||||
|
@ -216,7 +216,7 @@ There are a couple of exceptions to this flow:
|
|||
|
||||
### Attach to existing container
|
||||
|
||||
When [attaching to an existing container](/docs/remote/attach-container.md), you will be asked to confirm that attaching means you trust the container. This is only confirmed once.
|
||||
When [attaching to an existing container](/docs/devcontainers/attach-container.md), you will be asked to confirm that attaching means you trust the container. This is only confirmed once.
|
||||
|
||||
![Workspace trust prompt when attaching to container](images/containers/attach-containers-trust.png)
|
||||
|
||||
|
@ -258,7 +258,7 @@ You can use any image, Dockerfile, or set of Docker Compose files as a starting
|
|||
|
||||
Selecting the **Dev Containers: Add Dev Container Configuration Files...** command from the Command Palette (`kbstyle(F1)`) will add the needed files to your project as a starting point, which you can further customize for your needs. The command lets you pick a pre-defined container configuration from a list based on your folder's contents, reuse an existing Dockerfile, or reuse an existing Docker Compose file.
|
||||
|
||||
To learn more about creating `devcontainer.json` files, see [Create a Development Container](/docs/remote/create-dev-container.md).
|
||||
To learn more about creating `devcontainer.json` files, see [Create a Development Container](/docs/devcontainers/create-dev-container.md).
|
||||
|
||||
## Dev Container Features (preview)
|
||||
|
||||
|
@ -309,9 +309,9 @@ Features are an active proposal in the open-source [Development Containers Speci
|
|||
|
||||
We recommend pre-building images with the tools you need rather than creating and building a container image each time you open your project in a dev container. Using pre-built images will result in a faster container startup, simpler configuration, and allows you to pin to a specific version of tools to improve supply-chain security and avoid potential breaks. You can automate pre-building your image by scheduling the build using a DevOps or continuous integration (CI) service like GitHub Actions.
|
||||
|
||||
We recommend using the [devcontainer CLI](/docs/remote/devcontainer-cli.md) to pre-build your images since it is kept in sync with the Remote - Container extension's latest capabilities - including [dev container Features](#dev-container-features-preview). Once you've built your image, you can push it to a container registry (like the [Azure Container Registry](https://learn.microsoft.com/azure/container-registry/container-registry-get-started-docker-cli?tabs=azure-cli), [GitHub Container Registry](https://docs.github.com/packages/working-with-a-github-packages-registry/working-with-the-container-registry#pushing-container-images), or [Docker Hub](https://docs.docker.com/engine/reference/commandline/push)) and reference it directly.
|
||||
We recommend using the [devcontainer CLI](/docs/devcontainers/devcontainer-cli.md) to pre-build your images since it is kept in sync with the Dev Containers extension's latest capabilities - including [dev container Features](#dev-container-features-preview). Once you've built your image, you can push it to a container registry (like the [Azure Container Registry](https://learn.microsoft.com/azure/container-registry/container-registry-get-started-docker-cli?tabs=azure-cli), [GitHub Container Registry](https://docs.github.com/packages/working-with-a-github-packages-registry/working-with-the-container-registry#pushing-container-images), or [Docker Hub](https://docs.docker.com/engine/reference/commandline/push)) and reference it directly.
|
||||
|
||||
See the [devcontainer CLI article on pre-building images](/docs/remote/devcontainer-cli.md#prebuilding) for more information.
|
||||
See the [devcontainer CLI article on pre-building images](/docs/devcontainers/devcontainer-cli.md#prebuilding) for more information.
|
||||
|
||||
## Inspecting volumes
|
||||
|
||||
|
@ -333,7 +333,7 @@ If you install an extension from the Extensions view, it will automatically be i
|
|||
|
||||
![Workspace Extension Category](images/containers/containers-installed-remote-indicator.png)
|
||||
|
||||
![Local Extension Category](images/common/local-installed-extensions.png)
|
||||
![Local Extension Category](images/containers/local-installed-extensions.png)
|
||||
|
||||
> **Note:** If you are an extension author and your extension is not working properly or installs in the wrong place, see [Supporting Remote Development](/api/advanced-topics/remote-extensions.md) for details.
|
||||
|
||||
|
@ -345,11 +345,11 @@ You can also install all locally installed extensions inside the Dev Container b
|
|||
|
||||
![Install all extensions](images/containers/install-all-extn-containers.png)
|
||||
|
||||
However, some extensions may require you to [install additional software](/docs/remote/create-dev-container.md#install-additional-software) in the container. Consult extension documentation for details if you encounter issues.
|
||||
However, some extensions may require you to [install additional software](/docs/devcontainers/create-dev-container.md#install-additional-software) in the container. Consult extension documentation for details if you encounter issues.
|
||||
|
||||
### Adding an extension to devcontainer.json
|
||||
|
||||
While you can edit your [devcontainer.json](/docs/remote/create-dev-container.md#create-a-devcontainerjson-file) file by hand to add a list of extension IDs, you can also right-click on any extension in the Extensions view and select **Add to devcontainer.json**.
|
||||
While you can edit your [devcontainer.json](/docs/devcontainers/create-dev-container.md#create-a-devcontainerjson-file) file by hand to add a list of extension IDs, you can also right-click on any extension in the Extensions view and select **Add to devcontainer.json**.
|
||||
|
||||
![Add to devcontainer.json menu](images/containers/containers-addto-devcontainer.png)
|
||||
|
||||
|
@ -405,7 +405,7 @@ This same information is available in the **Forwarded Ports** section of the Rem
|
|||
|
||||
If you would like VS Code to remember any ports you have forwarded, check **Remote: Restore Forwarded Ports** in the Settings editor (`kb(workbench.action.openSettings)`) or set `"remote.restoreForwardedPorts": true` in `settings.json`.
|
||||
|
||||
![Restore forwarded ports setting](images/common/restore-forwarded-ports.png)
|
||||
![Restore forwarded ports setting](images/containers/restore-forwarded-ports.png)
|
||||
|
||||
### Publishing a port
|
||||
|
||||
|
@ -572,7 +572,7 @@ While you can use the command line to manage your containers, you can also use t
|
|||
|
||||
![Containers Explorer screenshot](images/containers/containers-explorer.png)
|
||||
|
||||
If you want to clean out images or mass-delete containers, see [Cleaning out unused containers and images](/docs/remote/troubleshooting.md#cleaning-out-unused-containers-and-images) for different options.
|
||||
If you want to clean out images or mass-delete containers, see [Cleaning out unused containers and images](/docs/devcontainers/tips-and-tricks.md#cleaning-out-unused-containers-and-images) for different options.
|
||||
|
||||
## Personalizing with dotfile repositories
|
||||
|
||||
|
@ -632,7 +632,7 @@ See [here for a list of active issues](https://aka.ms/vscode-remote/containers/i
|
|||
|
||||
### Docker limitations
|
||||
|
||||
* First-time installs of Docker Desktop for Windows when not using the WSL 2 engine will require an additional "sharing" step to give your container access to local source code. However, this step may not work with certain AAD (email-based) identities. See [Docker Desktop for Windows tips](/docs/remote/troubleshooting.md#docker-desktop-for-windows-tips) and [Enabling file sharing in Docker Desktop](/docs/remote/troubleshooting.md#enabling-file-sharing-in-docker-desktop) for details and workarounds.
|
||||
* First-time installs of Docker Desktop for Windows when not using the WSL 2 engine will require an additional "sharing" step to give your container access to local source code. However, this step may not work with certain AAD (email-based) identities. See [Docker Desktop for Windows tips](/docs/devcontainers/tips-and-tricks.md#docker-desktop-for-windows-tips) and [Enabling file sharing in Docker Desktop](/docs/devcontainers/tips-and-tricks.md#enabling-file-sharing-in-docker-desktop) for details and workarounds.
|
||||
* You may see errors if you sign in to Docker with your email address instead of your Docker ID. This is a known issue and can be resolved by signing in with your Docker ID instead. See Docker [issue #935](https://github.com/docker/hub-feedback/issues/935#issuecomment-300361781) for details.
|
||||
* If you see high CPU spikes for `com.docker.hyperkit` on macOS, this may be due to a [known issue with Docker for Mac](https://github.com/docker/for-mac/issues/1759). See the Docker issue for details.
|
||||
|
||||
|
@ -648,74 +648,9 @@ Many extensions will work inside dev containers without modification. However, i
|
|||
|
||||
In addition, while Alpine 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](/docs/remote/linux.md) article for details.
|
||||
|
||||
## Common questions
|
||||
|
||||
### I am seeing errors when trying to mount the local filesystem into a container
|
||||
|
||||
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](/docs/remote/troubleshooting.md#docker-desktop-for-windows-tips) for information on workarounds to common Docker for Windows issues.
|
||||
|
||||
### I'm seeing an error about a missing library or dependency
|
||||
|
||||
Some extensions rely on libraries not found in specific Docker images. For example, [Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) requires the installation of system-level dependencies, which are [listed in their documentation](https://learn.microsoft.com/visualstudio/liveshare/reference/linux#install-prerequisites-manually). 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](/docs/remote/create-dev-container.md#install-additional-software) for help with resolving the problem.
|
||||
|
||||
### Can I connect to multiple containers at once?
|
||||
|
||||
A VS Code window can only connect to one window currently, but you can open a new window and [attach](/docs/remote/attach-container.md) to an already running container or [use a common Docker Compose file with multiple `devcontainer.json` files](/remote/advancedcontainers/connect-multiple-containers.md) to automate the process a bit more.
|
||||
|
||||
### Can I work with containers on a remote host?
|
||||
|
||||
Yes, see the section on [opening a folder on a remote SSH host in a container](#open-a-folder-on-a-remote-ssh-host-in-a-container) for information.
|
||||
|
||||
### How can I build or deploy container images into my local Docker / Kubernetes install when working inside a container?
|
||||
|
||||
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-from-Docker](https://aka.ms/vscode-remote/samples/docker-from-docker), [Docker-from-Docker Compose](https://aka.ms/vscode-remote/samples/docker-from-docker-compose), and [Kubernetes-Helm](https://aka.ms/vscode-remote/samples/kubernetes-helm) dev container definitions for details.
|
||||
|
||||
### What are the connectivity requirements for the VS Code Server when it is running in a container?
|
||||
|
||||
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](https://learn.microsoft.com/visualstudio/liveshare/reference/connectivity#requirements-for-connection-modes)) 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.
|
||||
|
||||
### As an extension author, what do I need to do to make sure my extension works?
|
||||
|
||||
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](/api/advanced-topics/remote-extensions.md) for details.
|
||||
|
||||
### What other resources are there that may be able to answer my question?
|
||||
|
||||
The following articles may help answer your question:
|
||||
|
||||
* [Advanced container configuration](/remote/advancedcontainers/overview.md) or [Tips and Tricks](/docs/remote/troubleshooting.md#container-tips)
|
||||
* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/)
|
||||
* [Docker Compose file reference](https://docs.docker.com/compose/compose-file/)
|
||||
* [Docker Desktop for Windows troubleshooting guide](https://docs.docker.com/docker-for-windows/troubleshoot) and [FAQ](https://docs.docker.com/docker-for-windows/faqs/)
|
||||
* [Docker Desktop for Mac troubleshooting guide](https://docs.docker.com/docker-for-mac/troubleshoot) and [FAQ](https://docs.docker.com/docker-for-mac/faqs/)
|
||||
* [Docker Support Resources](https://success.docker.com/article/best-support-resources)
|
||||
|
||||
### Can I use dev containers outside of VS Code?
|
||||
|
||||
As containerizing production workloads becomes commonplace, dev containers have become useful for scenarios beyond VS Code. We're creating the [Development Container Specification](https://containers.dev/implementors/spec) 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](https://containers.dev), and you can review active proposals and contribute to the specification in the [devcontainers/spec](https://github.com/devcontainers/spec) repository on GitHub.
|
||||
|
||||
## Questions or feedback
|
||||
|
||||
* See [Tips and Tricks](/docs/remote/troubleshooting.md#container-tips) or the [FAQ](/docs/remote/faq.md).
|
||||
* See [Tips and Tricks](/docs/devcontainers/tips-and-tricks.md) or the [FAQ](/docs/devcontainers/faq.md).
|
||||
* Search on [Stack Overflow](https://stackoverflow.com/questions/tagged/vscode-remote).
|
||||
* Add a [feature request](https://aka.ms/vscode-remote/feature-requests) or [report a problem](https://aka.ms/vscode-remote/issues/new).
|
||||
* Create a [development container definition](https://aka.ms/vscode-dev-containers) for others to use.
|
||||
|
@ -725,7 +660,7 @@ You can learn more and review the specification at [containers.dev](https://cont
|
|||
|
||||
## Next steps
|
||||
|
||||
* [Attach to a Running Container](/docs/remote/attach-container.md) - Attach to an already running Docker container.
|
||||
* [Create a Development Container](/docs/remote/create-dev-container.md) - Create a custom container for your work environment.
|
||||
* [Attach to a Running Container](/docs/devcontainers/attach-container.md) - Attach to an already running Docker container.
|
||||
* [Create a Development Container](/docs/devcontainers/create-dev-container.md) - Create a custom container for your work environment.
|
||||
* [Advanced Containers](/remote/advancedcontainers/overview.md) - Find solutions to advanced container scenarios.
|
||||
* [devcontainer.json reference](https://containers.dev/implementors/json_reference) - Review the `devcontainer.json` schema.
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
Order: 11
|
||||
Area: remote
|
||||
Area: devcontainers
|
||||
TOCTitle: Create a Dev Container
|
||||
PageTitle: Create a development container using Visual Studio Code Remote Development
|
||||
ContentId: bae55561-1032-40d4-b6a6-47054da96098
|
||||
MetaDescription: Create a development container using Visual Studio Code Remote Development
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Create a development container
|
||||
# Create a Dev Container
|
||||
|
||||
The **Visual Studio Code Dev Containers** extension lets you use a [Docker container](https://docker.com) as a full-featured development environment. It allows you to open any folder or repository inside a container and take advantage of Visual Studio Code's full feature set. A `devcontainer.json` file in your project tells VS Code how to access (or create) a **development container** with a well-defined tool and runtime stack. This container can be used to run an application or to separate tools, libraries, or runtimes needed for working with a codebase.
|
||||
|
||||
|
@ -64,11 +64,11 @@ For this example, if you'd like to install the [ESLint extension](https://market
|
|||
|
||||
With the above `devcontainer.json`, your dev container is functional, and you can connect to and start developing within it. Try it out with the **Dev Containers: Reopen in Container** command:
|
||||
|
||||
![Quick pick with list of Dev Containers commands](images/containers/dev-containers-reopen.png)
|
||||
![Quick pick with list of Dev Containers commands](images/create-dev-container/dev-containers-reopen.png)
|
||||
|
||||
After running this command, when VS Code restarts, you're now within a Node.js and TypeScript dev container with port 3000 forwarded and the ESLint extension installed. Once you're connected, notice the green remote indicator on the left of the Status bar to show you are connected to your dev container:
|
||||
|
||||
![VS Code instance connected to dev container](images/containers/connected-to-dev-container.png)
|
||||
![VS Code instance connected to dev container](images/create-dev-container/connected-to-dev-container.png)
|
||||
|
||||
### Additional dev container scenarios
|
||||
|
||||
|
@ -78,7 +78,7 @@ Through a `devcontainer.json` file, you can:
|
|||
* Work with a container deployed application defined by an image, [Dockerfile](#dockerfile), or [Docker Compose](#use-docker-compose).
|
||||
* [Use Docker or Kubernetes](/remote/advancedcontainers/use-docker-kubernetes.md) from inside a dev container to build and deploy your app.
|
||||
|
||||
If `devcontainer.json`'s supported workflows do not meet your needs, you can also [attach to an already running container instead](/docs/remote/attach-container.md).
|
||||
If `devcontainer.json`'s supported workflows do not meet your needs, you can also [attach to an already running container instead](/docs/devcontainers/attach-container.md).
|
||||
|
||||
> **Tip:** Want to use a remote Docker host? See the [Develop on a remote Docker host](/remote/advancedcontainers/develop-remote-host.md) article for details on setup.
|
||||
|
||||
|
@ -127,7 +127,7 @@ For example, you could install the latest version of the Azure CLI with the foll
|
|||
}
|
||||
```
|
||||
|
||||
See the article on [dev container features](/docs/remote/containers.md#dev-container-features-preview) for more details.
|
||||
See the article on [dev container features](/docs/devcontainers/containers.md#dev-container-features-preview) for more details.
|
||||
|
||||
### Rebuild
|
||||
|
||||
|
@ -197,7 +197,7 @@ Rather than creating a `.devcontainer` by hand, selecting the **Dev Containers:
|
|||
|
||||
The command lets you pick a pre-defined container configuration from a list based on your folder's contents:
|
||||
|
||||
![Add a dev container definition](images/containers/select-dev-container-def-all.png)
|
||||
![Add a dev container definition](images/create-dev-container/select-dev-container-def-all.png)
|
||||
|
||||
All of the predefined container configurations you can pick from come from the [vscode-dev-containers repository](https://aka.ms/vscode-dev-containers), which has examples of `devcontainer.json` and Dockerfiles for different scenarios.
|
||||
|
||||
|
@ -207,7 +207,7 @@ At the end of using **Dev Containers: Add Dev Container Configuration Files...**
|
|||
|
||||
You can also reuse an existing Dockerfile:
|
||||
|
||||
![Select Dockerfile](images/containers/select-dockerfile.png)
|
||||
![Select Dockerfile](images/create-dev-container/select-dockerfile.png)
|
||||
|
||||
Now that you have a `devcontainer.json` and Dockerfile, let's see the general process for editing container configuration files.
|
||||
|
||||
|
@ -217,7 +217,7 @@ Editing your container configuration is easy. Since rebuilding a container will
|
|||
|
||||
Here is the typical edit loop using these commands:
|
||||
|
||||
![Container edit loop illustration](images/containers/container-edit-loop.png)
|
||||
![Container edit loop illustration](images/create-dev-container/container-edit-loop.png)
|
||||
|
||||
1. Start with **Dev Containers: Add Dev Container Configuration Files...** in the Command Palette (`kbstyle(F1)`).
|
||||
2. Edit the contents of the `.devcontainer` folder as required.
|
||||
|
@ -254,7 +254,7 @@ VS Code can be configured to **automatically start any needed containers** for a
|
|||
|
||||
To get started quickly, **open the folder** you want to work with in VS Code and run the **Dev Containers: Add Dev Container Configuration Files...** command in the Command Palette (`kbstyle(F1)`).
|
||||
|
||||
![Select Docker Compose File](images/containers/select-docker-compose.png)
|
||||
![Select Docker Compose File](images/create-dev-container/select-docker-compose.png)
|
||||
|
||||
You'll be asked to either select an existing Docker Compose file (if one exists), or pick a pre-defined container configuration from the [vscode-dev-containers repository](https://github.com/microsoft/vscode-dev-containers) in a filterable list sorted based on your folder's contents. Many of these "dev container definitions" use a Dockerfile, so select one of the following definitions as a starting point for Docker Compose:
|
||||
|
||||
|
@ -442,7 +442,7 @@ Congratulations! You've now configured a dev container in Visual Studio Code. Co
|
|||
|
||||
You can easily share a customized dev container definition for your project by adding `devcontainer.json` files to source control. By including these files in your repository, anyone that opens a local copy of your repo in VS Code will be automatically prompted to reopen the folder in a container, provided they have the Dev Containers extension installed.
|
||||
|
||||
![Dev container configuration file reopen notification](images/containers/dev-container-reopen-prompt.png)
|
||||
![Dev container configuration file reopen notification](images/create-dev-container/dev-container-reopen-prompt.png)
|
||||
|
||||
Beyond the advantages of having your team use a consistent environment and tool-chain, this also makes it easier for new contributors or team members to be productive quickly. First-time contributors will require less guidance and hit fewer issues related to environment setup.
|
||||
|
||||
|
@ -470,7 +470,7 @@ First, update the **Dev > Containers: Repository Configuration Paths** [User set
|
|||
|
||||
In the Settings editor, you can search for 'dev containers repo' to find the setting:
|
||||
|
||||
![Repository container folders setting](images/containers/repo-container-folder-setting.png)
|
||||
![Repository container folders setting](images/create-dev-container/repo-container-folder-setting.png)
|
||||
|
||||
Next, place your `.devcontainer/devcontainer.json` (and related files) in a sub folder that mirrors the remote location of the repository. For example, if you wanted to create a configuration for `github.com/microsoft/vscode-dev-containers`, you would create the following folder structure:
|
||||
|
||||
|
@ -487,6 +487,6 @@ The path used for looking up the configuration is derived from the output of `gi
|
|||
|
||||
## Next steps
|
||||
|
||||
* [Attach to a Running Container](/docs/remote/attach-container.md) - Attach to an already running Docker container.
|
||||
* [Attach to a Running Container](/docs/devcontainers/attach-container.md) - Attach to an already running Docker container.
|
||||
* [Advanced Containers](/remote/advancedcontainers/overview.md) - Find solutions to advanced container scenarios.
|
||||
* [devcontainer.json reference](https://containers.dev/implementors/json_reference) - Review the `devcontainer.json` schema.
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
Order: 14
|
||||
Area: remote
|
||||
TOCTitle: devcontainer CLI
|
||||
Area: devcontainers
|
||||
TOCTitle: Dev Container CLI
|
||||
PageTitle: Installing and working with the devcontainer CLI
|
||||
ContentId: 8946213d-716e-41ca-955f-944a41c70353
|
||||
MetaDescription: Documentation on using the development container (dev container) command-line interface
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Development container CLI
|
||||
# Dev Container CLI
|
||||
|
||||
This topic covers the development container command-line interface (dev container CLI), which allows you to build and manage development containers, and is a companion to the [Development Containers Specification](https://containers.dev).
|
||||
|
||||
|
@ -19,7 +19,7 @@ Containers (for example [Docker](https://www.docker.com) containers) have histor
|
|||
|
||||
![Diagram comparing dev versus production containers](images/devcontainer-cli/dev-container-stages.png)
|
||||
|
||||
Development containers are supported in Visual Studio Code via the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) and in [GitHub Codespaces](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers). This support is backed by [devcontainer.json](https://containers.dev/implementors/json_reference), a structured JSON with Comments (jsonc) metadata format to configure a containerized environment.
|
||||
Development containers are supported in Visual Studio Code via the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension and in [GitHub Codespaces](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers). This support is backed by [devcontainer.json](https://containers.dev/implementors/json_reference), a structured JSON with Comments (jsonc) metadata format to configure a containerized environment.
|
||||
|
||||
As containerizing production workloads becomes commonplace, dev containers have become broadly useful for scenarios beyond VS Code. To promote dev containers in any environment, work has started on the [Development Containers Specification](https://github.com/devcontainers/spec), which empowers anyone in any tool to configure a consistent dev environment. The open-source **dev container CLI** serves as the reference implementation of the specification.
|
||||
|
||||
|
@ -36,7 +36,7 @@ The CLI is available for review in a new [devcontainers/cli](https://github.com/
|
|||
To use the VS Code dev container CLI, you'll need the following on your system or CI/DevOps environment:
|
||||
|
||||
1. [Node.js (version 14 or greater)](https://nodejs.org).
|
||||
1. [The `docker` CLI](/docs/remote/containers#installation).
|
||||
1. [The `docker` CLI](/docs/devcontainers/containers.md#installation).
|
||||
1. [Python](https://www.python.org/downloads)
|
||||
1. C/C++ compiler
|
||||
|
||||
|
@ -138,7 +138,7 @@ For example, you may want to pre-build a number of images that you then reuse ac
|
|||
|
||||
1. [Create](/docs/sourcecontrol/overview.md#initialize-a-repository) a source code repository.
|
||||
|
||||
1. Create dev container configuration for each image you want to pre-build, customizing as you wish (including [dev container Features](/docs/remote/containers.md#dev-container-features-preview)). For example, consider this `devcontainer.json` file:
|
||||
1. Create dev container configuration for each image you want to pre-build, customizing as you wish (including [dev container Features](/docs/devcontainers/containers.md#dev-container-features-preview)). For example, consider this `devcontainer.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -198,5 +198,5 @@ The dev container CLI and specification are under active development and we welc
|
|||
|
||||
* [Dev container specification repository](https://github.com/devcontainers/spec) - Read and contribute to the open specification.
|
||||
* [devcontainer.json reference](https://containers.dev/implementors/json_reference) - Review the `devcontainer.json` schema.
|
||||
* [Create a Development Container](/docs/remote/create-dev-container.md) - Create a custom container for your work environment.
|
||||
* [Create a Development Container](/docs/devcontainers/create-dev-container.md) - Create a custom container for your work environment.
|
||||
* [Advanced Containers](/remote/advancedcontainers/overview.md) - Find solutions to advanced container scenarios.
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
Order: 13
|
||||
Area: remote
|
||||
Area: devcontainers
|
||||
TOCTitle: devcontainer.json
|
||||
PageTitle: devcontainer.json reference
|
||||
ContentId: 52eaec33-21c6-410c-8e10-1ee3658a854f
|
||||
|
@ -13,7 +13,7 @@ DateApproved: 10/6/2022
|
|||
|
||||
## Dev container specification
|
||||
|
||||
As mentioned in the main [Dev Containers documentation](/docs/remote/containers.md), we're creating the **Development Containers Specification** to empower anyone in any tool to configure a consistent dev environment.
|
||||
As mentioned in the main [Dev Containers documentation](/docs/devcontainers/containers.md), we're creating the **Development Containers Specification** to empower anyone in any tool to configure a consistent dev environment.
|
||||
|
||||
The `devcontainer.json` reference is [hosted on the specification site](https://containers.dev/implementors/json_reference). Here you can also review the [devcontainer.json schema](https://containers.dev/implementors/json_schema).
|
||||
|
||||
|
@ -21,6 +21,6 @@ You can also review the specification documents and latest proposals in the [dev
|
|||
|
||||
## Additional resources
|
||||
|
||||
[Create a development container](/docs/remote/create-dev-container.md) has more information on configuring a dev container, or you can use the **Dev Containers: Add Dev Container Configuration Files...** or **Codespaces: Add Dev Container Configuration Files...** commands from the Command Palette (`kbstyle(F1)`) to add a wide variety of base configurations.
|
||||
[Create a development container](/docs/devcontainers/create-dev-container.md) has more information on configuring a dev container, or you can use the **Dev Containers: Add Dev Container Configuration Files...** or **Codespaces: Add Dev Container Configuration Files...** commands from the Command Palette (`kbstyle(F1)`) to add a wide variety of base configurations.
|
||||
|
||||
> **Tip:** If you've already built a container and connected to it, be sure to run **Dev Containers: Rebuild Container** or **Codespaces: Rebuild Container** from the Command Palette (`kbstyle(F1)`) to pick up any changes you make.
|
|
@ -0,0 +1,85 @@
|
|||
---
|
||||
Order: 16
|
||||
Area: devcontainers
|
||||
TOCTitle: FAQ
|
||||
PageTitle: Visual Studio Code Dev Containers Frequently Asked Questions
|
||||
ContentId: c4784db6-ab00-4ac7-bca8-88edb638c593
|
||||
MetaDescription: Visual Studio Code troubleshooting tips and tricks for Dev Containers
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Dev Containers FAQ
|
||||
|
||||
This article includes some of the common questions for getting the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension up and running in different environments.
|
||||
|
||||
## Do "dev container definitions" define how an application is deployed?
|
||||
|
||||
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](https://github.com/devcontainers/templates) includes a set of dev container definitions for some common development environments. You can also [attach to a running container](/docs/devcontainers/attach-container.md) without setting up a dev container definition, if you prefer to use an alternate container build or deployment workflow.
|
||||
|
||||
## Do "dev containers definitions" define how an application is built? Like Buildpacks?
|
||||
|
||||
No. The [Buildpacks](https://buildpacks.io/) 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.
|
||||
|
||||
## I am seeing errors when trying to mount the local filesystem into a container
|
||||
|
||||
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](/docs/devcontainers/tips-and-tricks.md#docker-desktop-for-windows-tips) for information on workarounds to common Docker for Windows issues.
|
||||
|
||||
## I'm seeing an error about a missing library or dependency
|
||||
|
||||
Some extensions rely on libraries not found in specific Docker images. For example, [Visual Studio Live Share](https://visualstudio.microsoft.com/services/live-share/) requires the installation of system-level dependencies, which are [listed in their documentation](https://learn.microsoft.com/visualstudio/liveshare/reference/linux#install-prerequisites-manually). 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](/docs/devcontainers/create-dev-container.md#install-additional-software) for help with resolving the problem.
|
||||
|
||||
## Can I connect to multiple containers at once?
|
||||
|
||||
A VS Code window can only connect to one window currently, but you can open a new window and [attach](/docs/devcontainers/attach-container.md) to an already running container or [use a common Docker Compose file with multiple `devcontainer.json` files](/remote/advancedcontainers/connect-multiple-containers.md) to automate the process a bit more.
|
||||
|
||||
## Can I work with containers on a remote host?
|
||||
|
||||
Yes, see the section on [opening a folder on a remote SSH host in a container](/docs/remote/ssh.md#open-a-folder-on-a-remote-ssh-host-in-a-container) for information.
|
||||
|
||||
## How can I build or deploy container images into my local Docker / Kubernetes install when working inside a container?
|
||||
|
||||
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-from-Docker](https://aka.ms/vscode-remote/samples/docker-from-docker), [Docker-from-Docker Compose](https://aka.ms/vscode-remote/samples/docker-from-docker-compose), and [Kubernetes-Helm](https://aka.ms/vscode-remote/samples/kubernetes-helm) dev container definitions for details.
|
||||
|
||||
## What are the connectivity requirements for the VS Code Server when it is running in a container?
|
||||
|
||||
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](https://learn.microsoft.com/visualstudio/liveshare/reference/connectivity#requirements-for-connection-modes)) 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.
|
||||
|
||||
## As an extension author, what do I need to do to make sure my extension works?
|
||||
|
||||
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](/api/advanced-topics/remote-extensions.md) for details.
|
||||
|
||||
## What other resources are there that may be able to answer my question?
|
||||
|
||||
The following articles may help answer your question:
|
||||
|
||||
* [Advanced container configuration](/remote/advancedcontainers/overview.md) or [Tips and Tricks](/docs/devcontainers/tips-and-tricks.md)
|
||||
* [Dockerfile reference](https://docs.docker.com/engine/reference/builder/)
|
||||
* [Docker Compose file reference](https://docs.docker.com/compose/compose-file/)
|
||||
* [Docker Desktop for Windows troubleshooting guide](https://docs.docker.com/docker-for-windows/troubleshoot) and [FAQ](https://docs.docker.com/docker-for-windows/faqs/)
|
||||
* [Docker Desktop for Mac troubleshooting guide](https://docs.docker.com/docker-for-mac/troubleshoot) and [FAQ](https://docs.docker.com/docker-for-mac/faqs/)
|
||||
* [Docker Support Resources](https://success.docker.com/article/best-support-resources)
|
||||
|
||||
## Can I use dev containers outside of VS Code?
|
||||
|
||||
As containerizing production workloads becomes commonplace, dev containers have become useful for scenarios beyond VS Code. We're creating the [Development Container Specification](https://containers.dev/implementors/spec) 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](https://containers.dev), and you can review active proposals and contribute to the specification in the [devcontainers/spec](https://github.com/devcontainers/spec) repository on GitHub.
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:af99a3965dd026c229dbe4ef01c1aeed30c7034c0b5c63f635da435901a661dc
|
||||
size 8758
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c4fa42231b71226ee3e910807e213f34051acf72395ea659634c1d60820e32b5
|
||||
size 4359
|
|
@ -0,0 +1,286 @@
|
|||
---
|
||||
Order: 15
|
||||
Area: devcontainers
|
||||
TOCTitle: Tips and Tricks
|
||||
PageTitle: Visual Studio Code Dev Containers Tips and Tricks
|
||||
ContentId: c4784db6-ab00-4ac7-bca8-88edb638c593
|
||||
MetaDescription: Visual Studio Code Remote Development troubleshooting tips and tricks for Dev Containers
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Dev Containers Tips and Tricks
|
||||
|
||||
This article includes some tips and tricks for getting the Dev Containers extension up and running in different environments.
|
||||
|
||||
## Docker Desktop for Windows tips
|
||||
|
||||
[Docker Desktop](https://www.docker.com/products/docker-desktop) for Windows works well in most setups, but there are a few "gotchas" that can cause problems. Here are some tips on avoiding them:
|
||||
|
||||
1. **Consider using the new Docker WSL 2 back-end on Windows 10 (2004+).** If you are using [Docker Desktop's WSL 2 back-end](https://aka.ms/vscode-remote/containers/docker-wsl2), you can use it to open folders inside WSL as well as locally. Containers are also shared between Windows and inside WSL and this new engine is less susceptible to file sharing issues. See the [quick start](/docs/devcontainers/containers.md#open-a-wsl-2-folder-in-a-container-on-windows) for details.
|
||||
|
||||
2. **Switch out of "Linux Containers on Windows (LCOW)" mode.** While disabled by default, recent versions of Docker support [Linux Containers on Windows (LCOW)](https://learn.microsoft.com/virtualization/windowscontainers/deploy-containers/linux-containers) that can allow you to use both Windows and Linux containers at the same time. However, this is a new feature, so you may encounter issues and the Dev Containers extension only supports Linux containers currently. You can switch out of LCOW mode at any time by right-clicking on the Docker task bar item and selecting **Switch to Linux Containers...** from the context menu.
|
||||
|
||||
3. **Make sure your firewall allows Docker to set up a shared drive.** Docker only needs to connect between two machine local IPs, but some firewall software may still block any drive sharing or the needed ports. See [this Docker KB article](https://success.docker.com/article/error-a-firewall-is-blocking-file-sharing-between-windows-and-the-containers) for next steps on resolving this problem.
|
||||
|
||||
Here are some tips that applied to older versions of Docker for Windows but should now be resolved. If you run into strage behaviors due to a possible regression, these tips have solved problems in the past.
|
||||
|
||||
1. **Use an AD domain account or local administrator account when sharing drives. Do not use an AAD (email-based) account.** AAD (email-based) accounts have well-known issues, as documented in Docker [issue #132](https://github.com/docker/for-win/issues/132) and [issue #1352](https://github.com/docker/for-win/issues/1352). If you must use an AAD account, create a separate local administrator account on your machine that you use purely for the purpose of sharing drives. Follow the [steps in this blog post](https://blogs.msdn.microsoft.com/stevelasker/2016/06/14/configuring-docker-for-windows-volumes/) to get everything set up.
|
||||
|
||||
2. **Stick with alphanumeric passwords to avoid drive sharing problems.** When asked to share your drives on Windows, you will be prompted for the username and password of an account with admin privileges on the machine. If you are warned about an incorrect username or password, this may be due to special characters in the password. For example, `!`, `[` and `]` are known to cause issues. Change your password to alphanumeric characters to resolve. See this issue about [Docker volume mounting problems](https://github.com/moby/moby/issues/23992#issuecomment-234979036) for details.
|
||||
|
||||
3. **Use your Docker ID to sign in to Docker (not your email).** The Docker CLI only supports using your Docker ID, so using your email can cause problems. See Docker [issue #935](https://github.com/docker/hub-feedback/issues/935#issuecomment-300361781) for details.
|
||||
|
||||
If you are still having trouble, see the [Docker Desktop for Windows troubleshooting guide](https://docs.docker.com/docker-for-windows/troubleshoot/#volumes).
|
||||
|
||||
## Enabling file sharing in Docker Desktop
|
||||
|
||||
The VS Code [Dev Containers](https://aka.ms/vscode-remote/download/containers) extension can only automatically mount your source code into a container if your code is in a folder or drive shared with Docker. If you open a dev container from a non-shared location, the container will successfully start but the workspace will be empty.
|
||||
|
||||
Note that this step is **not required** with [Docker Desktop's WSL 2 engine](https://aka.ms/vscode-remote/containers/docker-wsl2).
|
||||
|
||||
To change Docker's drive and folder sharing settings:
|
||||
|
||||
**Windows:**
|
||||
|
||||
1. Right-click on the Docker task bar item and select **Settings**.
|
||||
2. Go to **Resources > File Sharing** and check the drive(s) where your source code is located.
|
||||
3. If you see a message about your local firewall blocking the sharing action, see [this Docker KB article](https://success.docker.com/article/error-a-firewall-is-blocking-file-sharing-between-windows-and-the-containers) for next steps.
|
||||
|
||||
**macOS:**
|
||||
|
||||
1. Click on the Docker menu bar item and select **Preferences**.
|
||||
2. Go to **Resources > File Sharing**. Confirm that the folder containing your source code is under one of the shared folders listed.
|
||||
|
||||
## Resolving Git line ending issues in containers (resulting in many modified files)
|
||||
|
||||
Since Windows and Linux use different default line endings, Git may report a large number of modified files that have no differences aside from their line endings. To prevent this from happening, you can disable line ending conversion using a `.gitattributes` file or globally on the Windows side.
|
||||
|
||||
Typically adding or modifying a `.gitattributes` file in your repository is the most reliable way to solve this problem. Committing this file to source control will help others and allows you to vary behaviors by repository as appropriate. For example, adding the following to `.gitattributes` file to the root of your repository will force everything to be LF, except for Windows batch files that require CRLF:
|
||||
|
||||
```yaml
|
||||
* text=auto eol=lf
|
||||
*.{cmd,[cC][mM][dD]} text eol=crlf
|
||||
*.{bat,[bB][aA][tT]} text eol=crlf
|
||||
```
|
||||
|
||||
Note that this works in **Git v2.10+**, so if you are running into problems, be sure you've got a recent Git client installed. You can add other file types in your repository that require CRLF to this same file.
|
||||
|
||||
If you would prefer to still always upload Unix-style line endings (LF), you can use the `input` option.
|
||||
|
||||
```bash
|
||||
git config --global core.autocrlf input
|
||||
```
|
||||
|
||||
If you'd prefer to disable line-ending conversion entirely, run the following instead:
|
||||
|
||||
```bash
|
||||
git config --global core.autocrlf false
|
||||
```
|
||||
|
||||
Finally, you may need to clone the repository again for these settings to take effect.
|
||||
|
||||
## Avoid setting up Git in a container when using Docker Compose
|
||||
|
||||
See [Sharing Git credentials with your container](/docs/devcontainers/containers.md#sharing-git-credentials-with-your-container) in the main containers article for information on resolving this issue.
|
||||
|
||||
## Resolving hangs when doing a Git push or sync from a Container
|
||||
|
||||
If you clone a Git repository using SSH and your SSH key has a passphrase, VS Code's pull and sync features may hang when running remotely.
|
||||
|
||||
Either use an SSH key without a passphrase, clone using HTTPS, or run `git push` from the command line to work around the issue.
|
||||
|
||||
## Resolving errors about missing Linux dependencies
|
||||
|
||||
Some extensions rely on libraries not found in the certain Docker images. See the [Containers](/docs/devcontainers/create-dev-container.md#install-additional-software) article for a few options on resolving this issue.
|
||||
|
||||
## Speeding up containers in Docker Desktop
|
||||
|
||||
By default, Docker Desktop only gives containers a fraction of your machine capacity. In most cases, this is enough, but if you are doing something that requires more capacity, you can increase memory, CPU, or disk use.
|
||||
|
||||
First, try [stopping any running containers](/docs/devcontainers/containers.md#managing-containers) you are no longer using.
|
||||
|
||||
If this doesn't solve your problem, you may want to see if CPU usage is actually the issue or if there is something else going on. An easy way to check this is to install the [Resource Monitor extension](https://marketplace.visualstudio.com/items?itemName=mutantdino.resourcemonitor&ssr=false#overview). When installed in a container, it provides information about capacity for your containers in the Status bar.
|
||||
|
||||
![Resource use Status bar](images/tips-and-tricks/resource-monitor.png)
|
||||
|
||||
If you'd like this extension to always be installed, add this to your `settings.json`:
|
||||
|
||||
```json
|
||||
"dev.containers.defaultExtensions": [
|
||||
"mutantdino.resourcemonitor"
|
||||
]
|
||||
```
|
||||
|
||||
If you determine that you need to give your container more of your machine's capacity, follow these steps:
|
||||
|
||||
1. Right-click on the Docker task bar item and select **Settings** / **Preferences**.
|
||||
2. Go to **Advanced** to increase CPU, Memory, or Swap.
|
||||
3. On macOS, go to **Disk** to increase the amount of disk Docker is allowed to consume on your machine. On Windows, this is located under Advanced with the other settings.
|
||||
|
||||
Finally, if your container is **doing disk intensive** operations or you are just looking for faster response times, see [Improving container disk performance](/remote/advancedcontainers/improve-performance.md) for tips. VS Code's defaults optimize for convenience and universal support, but can be optimized.
|
||||
|
||||
## Cleaning out unused containers and images
|
||||
|
||||
If you see an error from Docker reporting that you are out of disk space, you can typically resolve this by cleaning out unused containers and images. There are a few ways to do this:
|
||||
|
||||
### Option 1: Use the Remote Explorer
|
||||
|
||||
You can delete containers by selecting the **Remote Explorer**, right-click on the container you want to remove, and select **Remove Container**.
|
||||
|
||||
![Remote Explorer screenshot](images/tips-and-tricks/containers-explorer-remove.png)
|
||||
|
||||
However, this does not clean up any images you may have downloaded, which can clutter up your system.
|
||||
|
||||
### Option 2: Use the Docker extension
|
||||
|
||||
1. Open a **local** window in VS Code (**File > New Window**).
|
||||
|
||||
2. Install the [Docker extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) from the Extensions view if not already present.
|
||||
|
||||
3. You can then go to the Docker view and expand the **Containers** or **Images** node, right-click, and select **Remove Container / Image**.
|
||||
|
||||
![Docker Explorer screenshot](images/tips-and-tricks/docker-remove.png)
|
||||
|
||||
### Option 3: Use the Docker CLI to pick containers to delete
|
||||
|
||||
1. Open a **local** terminal/command prompt (or use a local window in VS Code).
|
||||
2. Type `docker ps -a` to see a list of all containers.
|
||||
3. Type `docker rm <Container ID>` from this list to remove a container.
|
||||
4. Type `docker image prune` to remove any unused images.
|
||||
|
||||
If `docker ps` does not provide enough information to identify the container you want to delete, the following command will list all development containers managed by VS Code and the folder used to generate them.
|
||||
|
||||
```bash
|
||||
docker ps -a --filter="label=vsch.quality" --format "table \{{.ID}}\t\{{.Status}}\t\{{.Image}}\tvscode-\{{.Label \"vsch.quality\"}}\t\{{.Label \"vsch.local.folder\"}}"
|
||||
```
|
||||
|
||||
### Option 4: Use Docker Compose
|
||||
|
||||
1. Open a **local** terminal/command prompt (or use a local window in VS Code).
|
||||
2. Go to the directory with your `docker-compose.yml` file.
|
||||
3. Type `docker-compose down` to stop and delete the containers. If you have more than one Docker Compose file, you can specify additional Docker Compose files with the `-f` argument.
|
||||
|
||||
**Option 4: Delete all containers and images that are not running:**
|
||||
|
||||
1. Open a **local** terminal/command prompt (or use a local window in VS Code).
|
||||
2. Type `docker system prune --all`.
|
||||
|
||||
## Resolving Dockerfile build failures for images using Debian 8
|
||||
|
||||
When building containers that use images based on Debian 8/Jessie — such as older versions of the `node:8` image — you may encounter the following error:
|
||||
|
||||
```
|
||||
...
|
||||
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)
|
||||
E: Some index files failed to download. They have been ignored, or old ones used instead.
|
||||
...
|
||||
```
|
||||
|
||||
This is a [well known issue](https://github.com/debuerreotype/docker-debian-artifacts/issues/66) caused by the Debian 8 being "archived". More recent versions of images typically resolve this problem, often by upgrading to Debian 9/Stretch.
|
||||
|
||||
There are two ways to resolve this error:
|
||||
|
||||
* **Option 1**: Remove any containers that depend on the image, remove the image, and then try building again. This should download an updated image that is not affected by the problem. See [cleaning out unused containers and images](#cleaning-out-unused-containers-and-images) for details.
|
||||
|
||||
* **Option 2**: If you don't want to delete your containers or images, add this line into your Dockerfile before any `apt` or `apt-get` command. It adds the needed source lists for Jessie:
|
||||
|
||||
```docker
|
||||
# Add archived sources to source list if base image uses Debian 8 / Jessie
|
||||
RUN cat /etc/*-release | grep -q jessie && printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
|
||||
```
|
||||
|
||||
## Resolving Docker Hub sign in errors when an email is used
|
||||
|
||||
The Docker CLI only supports using your Docker ID, so using your email to sign in can cause problems. See Docker [issue #935](https://github.com/docker/hub-feedback/issues/935#issuecomment-300361781) for details.
|
||||
|
||||
As a workaround, use your Docker ID to sign in to Docker rather than your email.
|
||||
|
||||
## High CPU utilization of Hyperkit on macOS
|
||||
|
||||
There is [known issue with Docker for Mac](https://github.com/docker/for-mac/issues/1759) that can drive high CPU spikes. In particular, high CPU usage occurring when watching files and building. If you see high CPU usage for `com.docker.hyperkit` in Activity Monitor while very little is going on in your dev container, you are likely hitting this issue. Follow the [Docker issue](https://github.com/docker/for-mac/issues/1759) for updates and fixes.
|
||||
|
||||
## Using an SSH tunnel to connect to a remote Docker host
|
||||
|
||||
The [Develop inside a container on a remote Docker Machine or SSH host](/remote/advancedcontainers/develop-remote-host.md) article covers how to setup VS Code when working with a remote Docker host. This is often as simple as setting the [Docker extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) `docker.host` property in `settings.json` or the `DOCKER_HOST` environment variable to a `ssh://` or `tcp://` URI.
|
||||
|
||||
However, you may run into situations where this does not work in your environment due to SSH configuration complexity or other limitations. In this case, an SSH tunnel can be used as a fallback.
|
||||
|
||||
### Using an SSH tunnel as a fallback option
|
||||
|
||||
You can set up an SSH tunnel and forward the Docker socket from your remote host to your local machine.
|
||||
|
||||
Follow these steps:
|
||||
|
||||
1. Install an [OpenSSH compatible SSH client](/docs/remote/troubleshooting.md#installing-a-supported-ssh-client).
|
||||
|
||||
2. Update the [Docker extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) `docker.host` property in your user or workspace `settings.json` as follows:
|
||||
|
||||
```json
|
||||
"docker.host":"tcp://localhost:23750"
|
||||
```
|
||||
|
||||
3. Run the following command from a local terminal / PowerShell (replacing `user@hostname` with the remote user and hostname / IP for your server):
|
||||
|
||||
```bash
|
||||
ssh -NL localhost:23750:/var/run/docker.sock user@hostname
|
||||
```
|
||||
|
||||
VS Code will now be able to [attach to any running container](/docs/devcontainers/attach-container.md) on the remote host. You can also [use specialized, local `devcontainer.json` files to create / connect to a remote dev container](/remote/advancedcontainers/develop-remote-host.md#converting-an-existing-or-predefined-devcontainerjson).
|
||||
|
||||
Once you are done, press `kbstyle(Ctrl+C)` in the terminal / PowerShell to close the tunnel.
|
||||
|
||||
> **Note:** If the `ssh` command fails, you may need to `AllowStreamLocalForwarding` on your SSH host.
|
||||
>
|
||||
> 1. Open `/etc/ssh/sshd_config` in an editor (like Vim, nano, or Pico) on the **SSH host** (not locally).
|
||||
> 2. Add the setting `AllowStreamLocalForwarding yes`.
|
||||
> 3. Restart the SSH server (on Ubuntu, run `sudo systemctl restart sshd`).
|
||||
> 4. Retry.
|
||||
|
||||
## Persisting user profile
|
||||
|
||||
You can use the `mounts` property to persist the user profile (to keep things like shell history) in your dev container across rebuilds.
|
||||
|
||||
```json
|
||||
"mounts": [
|
||||
"source=profile,target=/root,type=volume",
|
||||
"target=/root/.vscode-server,type=volume"
|
||||
],
|
||||
```
|
||||
|
||||
The above code first creates a named volume called `profile` mounted to `/root`, which will survive a rebuild. It next creates an anonymous volume mounted to `/root/.vscode-server` that gets destroyed on rebuild, which allows VS Code to reinstall extensions and dotfiles.
|
||||
|
||||
## Advanced container configuration tips
|
||||
|
||||
See the [Advanced container configuration](/remote/advancedcontainers/overview.md) articles for information on the following topics:
|
||||
|
||||
* [Adding environment variables](/remote/advancedcontainers/environment-variables.md)
|
||||
* [Adding another local file mount](/remote/advancedcontainers/add-local-file-mount.md)
|
||||
* [Changing or removing the default source code mount](/remote/advancedcontainers/change-default-source-mount.md)
|
||||
* [Improving container disk performance](/remote/advancedcontainers/improve-performance.md)
|
||||
* [Adding a non-root user to your dev container](/remote/advancedcontainers/add-nonroot-user.md)
|
||||
* [Avoiding extension reinstalls on container rebuild](/remote/advancedcontainers/avoid-extension-reinstalls.md)
|
||||
* [Setting the project name for Docker Compose](/remote/advancedcontainers/set-docker-compose-project-name.md)
|
||||
* [Using Docker or Kubernetes from inside a container](/remote/advancedcontainers/use-docker-kubernetes.md)
|
||||
* [Connecting to multiple containers at once](/remote/advancedcontainers/connect-multiple-containers.md)
|
||||
* [Developing inside a container on a remote Docker Machine or SSH host](/remote/advancedcontainers/develop-remote-host.md)
|
||||
* [Reducing Dockerfile build warnings](/remote/advancedcontainers/reduce-docker-warnings.md)
|
||||
|
||||
## Extension tips
|
||||
|
||||
While many extensions will work unmodified, there are a few issues that can prevent certain features from working as expected. In some cases, you can use another command to work around the issue, while in others, the extension may need to be modified. The [Remote Extensions Tips](/docs/remote/troubleshooting.md#extension-tips) section provides a quick reference for common issues and tips on resolving them. You can also refer to the main extension article on [Supporting Remote Development](/api/advanced-topics/remote-extensions) for an in-depth guide on modifying extensions to support remote extension hosts.
|
||||
|
||||
## Questions and feedback
|
||||
|
||||
### Reporting issues
|
||||
|
||||
If you run into an issue with the Dev Containers extension, it's important to collect the correct logs so that we'll be able to help [diagnose your issue](https://aka.ms/vscode-remote/issues/new). You can get the Dev Containers extension logs with **Dev Containers: Show Container Log**.
|
||||
|
||||
If you're experiencing issues using other extensions remotely (for example, other extensions aren't loading or installing properly in a remote context), it's helpful to grab the log from the **Remote Extension Host** output channel (**Output: Focus on Output View**), and select **Log (Remote Extension Host)** from the dropdown.
|
||||
|
||||
> **Note**: If you only see **Log (Extension Host)**, this is the local extension host, and the remote extension host didn't launch. This is because the log channel is created only after the log file is created, so if the remote extension host does not launch, the remote extension host log file was not created and is not shown in the Output view. This is still helpful information to include in your issue.
|
||||
|
||||
### Remote question and feedback resources
|
||||
|
||||
We have a variety of other remote resources:
|
||||
|
||||
* Search on [Stack Overflow](https://stackoverflow.com/questions/tagged/vscode-remote).
|
||||
* Add a [feature request](https://aka.ms/vscode-remote/feature-requests) or [report a problem](https://aka.ms/vscode-remote/issues/new).
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
Order: 8
|
||||
Area: remote
|
||||
TOCTitle: Containers Tutorial
|
||||
Area: devcontainers
|
||||
TOCTitle: Tutorial
|
||||
PageTitle: Get started with development Containers in Visual Studio Code
|
||||
ContentId: 8e1fb9e0-1a67-4e0c-a21b-c5ab9a6d979c
|
||||
MetaDescription: Get started with development Containers in Visual Studio Code
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Remote development in Containers
|
||||
# Dev Containers tutorial
|
||||
|
||||
This tutorial walks you through running Visual Studio Code in a [Docker](https://www.docker.com/) container using the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. You need no prior knowledge of Docker to complete this tutorial.
|
||||
|
||||
|
@ -31,7 +31,7 @@ Run the Docker Desktop application to start Docker. You will know it's running i
|
|||
|
||||
Docker might take a few minutes to start. If the whale icon is animated, it is probably still in the process of starting. You can click on the icon to see the status.
|
||||
|
||||
![Docker status](images/containers-tutorial/docker-status.png)
|
||||
![Docker status](images/tutorial/docker-status.png)
|
||||
|
||||
### Check Docker
|
||||
|
||||
|
@ -48,17 +48,17 @@ The Dev Containers extension lets you run Visual Studio Code inside a Docker con
|
|||
|
||||
> <a class="install-extension-btn" href="vscode:extension/ms-vscode-remote.remote-containers">Install the Dev Containers extension</a>
|
||||
|
||||
![Dev Containers extension](images/containers-tutorial/dev-containers-extension.png)
|
||||
![Dev Containers extension](images/tutorial/dev-containers-extension.png)
|
||||
|
||||
### Check installation
|
||||
|
||||
With the Dev Containers extension installed, you will see a new Status bar item at the far left.
|
||||
|
||||
![Remote Status bar item](images/containers-tutorial/remote-status-bar.png)
|
||||
![Remote Status bar item](images/tutorial/remote-status-bar.png)
|
||||
|
||||
The Remote Status bar item can quickly show you in which context VS Code is running (local or remote) and clicking on the item will bring up the Dev Containers commands.
|
||||
|
||||
![Dev Containers commands](images/containers-tutorial/dev-containers-commands.png)
|
||||
![Dev Containers commands](images/tutorial/dev-containers-commands.png)
|
||||
|
||||
## Get the sample
|
||||
|
||||
|
@ -82,7 +82,7 @@ After the container is built, VS Code automatically connects to it and maps the
|
|||
|
||||
Once the container is running and you're connected, you should see your remote context change in the bottom left of the Status bar:
|
||||
|
||||
![Building image](images/containers-tutorial/connected.png)
|
||||
![Building image](images/tutorial/connected.png)
|
||||
|
||||
## Check your environment
|
||||
|
||||
|
@ -96,13 +96,13 @@ node --version; npm --version
|
|||
|
||||
This should show the following versions:
|
||||
|
||||
![Node.js version check](images/containers-tutorial/version-check-updated.png)
|
||||
![Node.js version check](images/tutorial/version-check-updated.png)
|
||||
|
||||
### Run the application
|
||||
|
||||
We can now hit `kb(workbench.action.debug.start)`, which will run the application inside the container. Once the process starts, navigate to [http://localhost:3000](http://localhost:3000) and you should see the simple Node.js server running!
|
||||
|
||||
![Running the application](images/containers-tutorial/hello-remote-world.png)
|
||||
![Running the application](images/tutorial/hello-remote-world.png)
|
||||
|
||||
### Ending your container connection
|
||||
|
||||
|
@ -166,7 +166,7 @@ The above example is taken from the `vscode-remote-try-node` repo we used in the
|
|||
|
||||
Congratulations, you've successfully completed this tutorial!
|
||||
|
||||
This has been a brief overview of what is possible using dev containers. As a next step, we recommend checking out how you can [open an existing folder from your machine in a container](/docs/remote/containers.md#quick-start-open-an-existing-folder-in-a-container) or [opening a GitHub repository or PR in a container](/docs/remote/containers.md#quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume).
|
||||
This has been a brief overview of what is possible using dev containers. As a next step, we recommend checking out how you can [open an existing folder from your machine in a container](/docs/devcontainers/containers.md#quick-start-open-an-existing-folder-in-a-container) or [opening a GitHub repository or PR in a container](/docs/devcontainers/containers.md#quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume).
|
||||
|
||||
Check out the other Remote Development extensions.
|
||||
|
|
@ -4,7 +4,7 @@ Area: java
|
|||
TOCTitle: GUI Applications
|
||||
ContentId: 517db620-d166-4f72-99c1-fa046710dffe
|
||||
PageTitle: Develop Java GUI Applications in Visual Studio Code
|
||||
DateApproved: 2/11/2022
|
||||
DateApproved: 10/11/2022
|
||||
MetaDescription: How to develop Java GUI Applications (JavaFX, AWT, Swing) in Visual Studio Code
|
||||
---
|
||||
|
||||
|
@ -34,7 +34,7 @@ You can create a new JavaFX application with just a few steps in VS Code:
|
|||
|
||||
To run the JavaFX application, you can open the **Maven** Explorer, expand `hellofx` > `Plugins` > `javafx` and run the Maven goal: `javafx:run`.
|
||||
|
||||
> Note: Make sure you have installed the [Maven for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven) extension. If you cannot find the **Maven** explorer, open the Command Palette (`kb(workbench.action.showCommands)`) and then select the command **Explorer: Focus on Maven View**.
|
||||
> **Note**: Make sure you have installed the [Maven for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven) extension. If you cannot find the **Maven** explorer, open the Command Palette (`kb(workbench.action.showCommands)`) and then select the command **Explorer: Focus on Maven View**.
|
||||
|
||||
<video autoplay loop muted playsinline controls>
|
||||
<source src="/docs/java/java-gui/run-javafx.mp4" type="video/mp4">
|
||||
|
|
|
@ -4,7 +4,7 @@ Area: java
|
|||
TOCTitle: Deploy Java Apps
|
||||
ContentId: 01210769-05be-4854-9482-13e342850ad7
|
||||
PageTitle: Deploy Java Web Apps
|
||||
DateApproved: 12/22/2021
|
||||
DateApproved: 10/18/2022
|
||||
MetaDescription: How to deploy Java applications to Azure with Visual Studio Code
|
||||
---
|
||||
# Deploy Java Web Apps
|
||||
|
@ -25,8 +25,8 @@ If you are interested in a specific Azure service, you can also directly search
|
|||
|
||||
The following tutorials below walk you through the details. You can also check the [Java Azure Developer's Center](https://learn.microsoft.com/azure/developer/java) for all things on Azure for Java developers.
|
||||
|
||||
| Tutorial | Description |
|
||||
| --- | --- |
|
||||
| [Deploy Java web apps to Azure App Service](/docs/java/java-webapp.md) | Deploy a web app using the [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice) extension. |
|
||||
| [Deploy Spring Microservices to Azure Spring Apps](/docs/java/java-spring-apps.md) | Deploy a web app using the [Azure Spring Apps](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-azurespringcloud) extension. |
|
||||
| [Create an Azure Functions project using Visual Studio Code](https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-java) | Deploy serverless code using the [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) extension. |
|
||||
| Tutorial | Description | Related Tools |
|
||||
| --- | --- | --- |
|
||||
| [Deploy Java web apps <br> to Azure App Service](/docs/java/java-webapp.md) | Deploy a web app to the cloud | [Apache Maven](https://maven.apache.org/download.cgi) <br> [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice)
|
||||
| [Deploy Spring Boot apps <br> to Azure Spring Apps](/docs/java/java-spring-apps.md) | Deploy a Spring Boot application<br> to Azure Spring Apps | [Apache Maven](https://maven.apache.org/download.cgi) <br> [Azure Spring Apps](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-azurespringcloud)
|
||||
| [Create an Azure Functions project <br> using Visual Studio Code](https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-java) | Deploy serverless code <br> using Azure Functions | [Apache Maven](https://maven.apache.org/download.cgi) <br> [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions)
|
||||
|
|
|
@ -20,7 +20,7 @@ Most of these features just work out of the box, while some may require basic co
|
|||
|
||||
IntelliSense shows you intelligent code completion, hover information, and signature information so that you can write code more quickly and correctly.
|
||||
|
||||
<video src="/docs/languages/javascript/intellisense.mp4" placeholder="images/javascript/intellisense-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/intellisense.mp4" placeholder="images/javascript/intellisense-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
@ -59,7 +59,7 @@ See [Working with JavaScript](/docs/nodejs/working-with-javascript.md) for more
|
|||
|
||||
VS Code includes basic JavaScript [snippets](/docs/editor/userdefinedsnippets.md) that are suggested as you type;
|
||||
|
||||
<video src="/docs/languages/javascript/snippets.mp4" placeholder="images/javascript/snippets-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/snippets.mp4" placeholder="images/javascript/snippets-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
@ -71,13 +71,13 @@ There are many extensions that provide additional snippets, including snippets f
|
|||
|
||||
VS Code understands many standard [JSDoc](https://jsdoc.app) annotations, and uses these annotations to provide rich [IntelliSense](#intellisense). You can optionally even use the type information from JSDoc comments to [type check your JavaScript](#type-checking).
|
||||
|
||||
<video src="/docs/languages/javascript/jsdoc-autofill.mp4" placeholder="images/javascript/jsdoc-autofill-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/jsdoc-autofill.mp4" placeholder="images/javascript/jsdoc-autofill-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
Quickly create JSDoc comments for functions by typing `/**` before the function declaration, and select the **JSDoc comment** snippet suggestion:
|
||||
|
||||
<video src="/docs/languages/javascript/jsdoc-autofill.mp4" placeholder="images/javascript/jsdoc-autofill-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/jsdoc-autofill.mp4" placeholder="images/javascript/jsdoc-autofill-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
@ -135,7 +135,7 @@ You can use JSX syntax in both normal `*.js` files and in `*.jsx` files.
|
|||
|
||||
VS Code also includes JSX-specific features such as autoclosing of JSX tags:
|
||||
|
||||
<video src="/docs/languages/javascript/tag-complete.mp4" placeholder="images/javascript/tag-complete-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/tag-complete.mp4" placeholder="images/javascript/tag-complete-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
@ -200,7 +200,7 @@ To disable fading out of unused code, set `"editor.showUnused"` to `false`. You
|
|||
The **Organize Imports** Source Action sorts the imports in a JavaScript file and removes any unused imports:
|
||||
|
||||
<!-- TODO: replace with js specific example -->
|
||||
<video src="/docs/languages/javascript/organize-imports.mp4" placeholder="images/javascript/organize-imports-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/organize-imports.mp4" placeholder="images/javascript/organize-imports-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
@ -241,7 +241,7 @@ See [Node.js/JavaScript](/docs/nodejs/working-with-javascript) for more informat
|
|||
|
||||
VS Code automatically suggests some common code simplifications such as converting a chain of `.then` calls on a promise to use `async` and `await`
|
||||
|
||||
<video src="/docs/languages/javascript/code-suggestions-convert-async.mp4" placeholder="images/javascript/code-suggestions-convert-async-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/code-suggestions-convert-async.mp4" placeholder="images/javascript/code-suggestions-convert-async-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
@ -303,7 +303,7 @@ Click on the reference count to quickly browse a list of references:
|
|||
|
||||
When you move or rename a file that is imported by other files in your JavaScript project, VS Code can automatically update all import paths that reference the moved file:
|
||||
|
||||
<video src="/docs/languages/javascript/update-imports.mp4" placeholder="images/javascript/update-imports-placeholder.png" autoplay loop controls muted>
|
||||
<video src="images/javascript/update-imports.mp4" placeholder="images/javascript/update-imports-placeholder.png" autoplay loop controls muted>
|
||||
Sorry, your browser doesn't support HTML 5 video.
|
||||
</video>
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ After installing Rust, you can check that everything is installed correctly by o
|
|||
rustc --version
|
||||
```
|
||||
|
||||
which will output the version of the Rust compiler. If you run into problems, you can consult the Rust [installation guide](https://doc.rust-lang.org/book/ch01-01-installation.html).
|
||||
which will output the version of the Rust compiler. If you want more details, you can add the `--verbose` argument. If you run into problems, you can consult the Rust [installation guide](https://doc.rust-lang.org/book/ch01-01-installation.html).
|
||||
|
||||
You can keep your Rust installation up to date with the latest version by running:
|
||||
|
||||
|
@ -47,7 +47,7 @@ You can keep your Rust installation up to date with the latest version by runnin
|
|||
rustup update
|
||||
```
|
||||
|
||||
There are new stable versions of Rust published very 6 weeks so this is a good habit.
|
||||
There are new stable versions of Rust published every 6 weeks so this is a good habit.
|
||||
|
||||
### Local Rust documentation
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:027c808d27ae82b77734a7fccc64d415e813ba77f6dc4bafda29c845c0275a56
|
||||
size 19510
|
|
@ -1,12 +1,24 @@
|
|||
---
|
||||
Order: 4
|
||||
Area: nodejs
|
||||
TOCTitle: Node.js Deployment
|
||||
TOCTitle: Deploy Node.js Apps
|
||||
PageTitle: Node.js Deployment with Visual Studio Code
|
||||
ContentId: 856a4a73-a4b4-4418-b88d-1f65d0ba7824
|
||||
MetaDescription: Node.js Deployment to Azure with Visual Studio Code
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Deploy a Node.js Application to Azure
|
||||
# Deploy Node.js Web Apps
|
||||
|
||||
This page is redirected to /docs/azure/deployment and only exists to create the "Node.js Deployment" TOC item.
|
||||
The [Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack) extensions for Visual Studio Code make it easy to deploy Node.js applications.
|
||||
|
||||
![Azure Tools extension](images/azure/azure-tools.png)
|
||||
|
||||
## Deployment tutorials
|
||||
|
||||
These tutorials from Microsoft Learn describe different ways of creating and deploying Node.js apps to Azure via Visual Studio Code:
|
||||
|
||||
Tutorial | Description | Related Tools
|
||||
--- | --- | ---
|
||||
[Deploy Azure Functions](https://learn.microsoft.com/azure/developer/javascript/tutorial/azure-function-cosmos-db-mongo-api) | Build and manage Azure Functions serverless apps <br> directly in VS Code | [Azure Resources](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups) <br> [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) <br> [Azure Databases](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-cosmosdb)
|
||||
[Deploy using Azure Portal <br> and Azure App Service](https://learn.microsoft.com/azure/app-service/tutorial-nodejs-mongodb-app) | Manage Azure resources directly in VS Code <br> with Azure App Service | [MongoDB](https://www.mongodb.com/docs/manual/installation/) <br> [Azure Portal](https://portal.azure.com/)
|
||||
[Deploy using Docker](https://learn.microsoft.com/azure/developer/javascript/tutorial/tutorial-vscode-docker-node/tutorial-vscode-docker-node-01) | Deploy your website using a Docker container | [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) <br> [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) <br> [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice) <br> [Azure Resources](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups)
|
||||
|
|
|
@ -4,7 +4,7 @@ Area: python
|
|||
TOCTitle: Editing Code
|
||||
ContentId: 0ccb0e35-c4b2-4001-91bf-79ff1618f601
|
||||
PageTitle: Editing Python Code in Visual Studio Code
|
||||
DateApproved: 11/05/2021
|
||||
DateApproved: 10/12/2022
|
||||
MetaDescription: Editing Python in Visual Studio Code
|
||||
MetaSocialImage: images/tutorial/social.png
|
||||
---
|
||||
|
@ -24,14 +24,13 @@ Autocomplete and IntelliSense are provided for all files within the current work
|
|||
|
||||
### Auto Imports
|
||||
|
||||
Pylance offers auto import suggestions for modules in your workspace and/or packages you have installed in your environment. This enables import statements to be conveniently added automatically as you're typing.
|
||||
[Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) offers auto import suggestions for modules in your workspace and/or packages you have installed in your environment. This enables import statements to be conveniently added automatically as you're typing.
|
||||
|
||||
By default, only top-level symbols/packages are suggested, but you can customize this behavior through the `python.analysis.packageIndexDepths` setting. See the section below on "Customize IntelliSense behavior" to learn more about IntelliSense controls.
|
||||
|
||||
|
||||
### Customize IntelliSense behavior
|
||||
|
||||
Because enabling the full set of IntelliSense features by default could end up making your development experience feel slower, we enable a minimum set of features that allow you to be productive while still having a performant experience. However, you can customize the behaviour of the analysis engine to your liking through multiple settings.
|
||||
Because enabling the full set of IntelliSense features by default could end up making your development experience feel slower, we enable a minimum set of features that allow you to be productive while still having a performant experience. However, you can customize the behavior of the analysis engine to your liking through multiple settings.
|
||||
|
||||
For the full list of available IntelliSense controls, you can reference the Python extension [code analysis settings](/docs/python/settings-reference.md#code-analysis-settings) and [autocomplete settings](/docs/python/settings-reference.md#autocomplete-settings).
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Area: python
|
|||
TOCTitle: Deploy Python Apps
|
||||
ContentId: 12bf713e-5f20-46ac-81bb-8e05565aba3a
|
||||
PageTitle: Deploy Python Web Apps
|
||||
DateApproved: 10/20/2021
|
||||
DateApproved: 10/12/2022
|
||||
MetaDescription: How to deploy Python applications to Azure with Visual Studio Code
|
||||
MetaSocialImage: images/tutorial/social.png
|
||||
---
|
||||
|
@ -18,8 +18,9 @@ The [Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.
|
|||
|
||||
The following tutorials on the [Python Azure Developer's Center](https://learn.microsoft.com/azure/developer/python) walk you though the details.
|
||||
|
||||
Tutorial | Description
|
||||
--- | ---
|
||||
[Deploy Python web apps to Azure App Service](https://learn.microsoft.com/azure/python/tutorial-deploy-app-service-on-linux-01) | Deploy a web app using the [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice) extension.
|
||||
[Deploy Python containers to Azure App Service](https://learn.microsoft.com/azure/developer/python/tutorial-deploy-containers-01) | Deploy a Docker container using the [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) extension.
|
||||
[Deploy Python to Azure Functions](https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-python) | Deploy serverless code using the [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) extension.
|
||||
Tutorial | Description | Related Tools
|
||||
--- | --- | ---
|
||||
[Deploy Python web app to Azure App Service](https://learn.microsoft.com/azure/app-service/quickstart-python) | Deploy a simple web app | [Django](https://www.djangoproject.com/) <br> [Flask](https://flask.palletsprojects.com/) <br> [Azure CLI](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azurecli) <br> [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice) <br> [Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack)
|
||||
[Deploy Python web app with database to Azure App Service](https://learn.microsoft.com/azure/app-service/tutorial-python-postgresql-app) | Deploy a web app with PostgreSQL database | [Django](https://www.djangoproject.com/) <br> [Flask](https://flask.palletsprojects.com/) <br> [PostgreSQL](https://www.postgresql.org/download/) <br> [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice) <br> [Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack)
|
||||
[Deploy Python containers to Azure App Service](https://learn.microsoft.com/azure/developer/python/tutorial-deploy-containers-01) | Deploy a Docker container | [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) <br> [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice) <br> [Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack)
|
||||
[Deploy Python to Azure Functions](https://learn.microsoft.com/azure/azure-functions/create-first-function-vs-code-python) | Deploy serverless code with Azure Functions | [Azure Functions Core Tools](https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#install-the-azure-functions-core-tools) <br> [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) <br> [Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack)
|
||||
|
|
|
@ -4,7 +4,7 @@ Area: python
|
|||
TOCTitle: Settings Reference
|
||||
ContentId: d256dc5c-95e9-4c02-a82f-947bf34a3517
|
||||
PageTitle: Settings Reference for Python
|
||||
DateApproved: 11/16/2021
|
||||
DateApproved: 10/12/2022
|
||||
MetaDescription: Settings Reference for the Python extension in Visual Studio Code
|
||||
MetaSocialImage: images/tutorial/social.png
|
||||
---
|
||||
|
|
|
@ -19,7 +19,7 @@ An environment is the "backend" half of GitHub Codespaces. It's where all of the
|
|||
|
||||
## Customization
|
||||
|
||||
GitHub Codespaces are fully customizable on a per project basis. This is accomplished by including a `devcontainer.json` file in the project's repository, similar to VS Code [Dev Containers](/docs/remote/containers.md) development.
|
||||
GitHub Codespaces are fully customizable on a per project basis. This is accomplished by including a `devcontainer.json` file in the project's repository, similar to VS Code [Dev Containers](/docs/devcontainers/containers.md) development.
|
||||
|
||||
Example customizations include:
|
||||
|
||||
|
@ -81,7 +81,7 @@ For several issues (especially keybindings or those listed with a workaround for
|
|||
| Downloading a file with no extension from the browser automatically adds ".txt" | This is how Chrome and Edge behave. | Context and potential future solutions in [issue #118436](https://github.com/microsoft/vscode/issues/118436). |
|
||||
| When you download a file from a remote (including Codespaces), attributes such as the executable bit are removed. | Context and potential future solutions can be found in [issue #112099](https://github.com/microsoft/vscode/issues/112099). | No current workarounds. |
|
||||
| You may see the prompt, "`Your_codespace_name` can't open this folder because it contains system files" when trying to download certain folders from a Codespace. | A user agent is free to impose the level of restrictions on sensitive directories. More information in [this spec](https://wicg.github.io/file-system-access/#privacy-wide-access) and [Chromium's blocklist](https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc;l=140-208). | No additional workarounds beyond the spec and blocklist. |
|
||||
| Manually visiting `http://localhost:forwarded_port` won't work to access a forwarded port from a Codespace in the web. | This is based on how Codespaces handles port forwarding and generates the correct URL for the web. | Click the link from the port forwarding notification to open your app, or the globe icon in the [Ports view](/docs/remote/containers.md#forwarding-or-publishing-a-port), both of which will provide the properly generated link. More information in the [Codespaces docs](https://docs.github.com/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace). |
|
||||
| Manually visiting `http://localhost:forwarded_port` won't work to access a forwarded port from a Codespace in the web. | This is based on how Codespaces handles port forwarding and generates the correct URL for the web. | Click the link from the port forwarding notification to open your app, or the globe icon in the [Ports view](/docs/devcontainers/containers.md#forwarding-or-publishing-a-port), both of which will provide the properly generated link. More information in the [Codespaces docs](https://docs.github.com/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace). |
|
||||
|
||||
### Some extensions behave differently in the web
|
||||
|
||||
|
@ -97,7 +97,7 @@ For several issues (especially keybindings or those listed with a workaround for
|
|||
| [Flutter](https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter) (and Flutter development overall) | Several aspects of the Flutter workflow are limited due to the nature of Docker containers and Codespaces.<ul><li>Flutter recommends installation from snap, but snap cannot be installed within the Codespaces container.</li><li>Android Emulation does not work within a container.</li><li>Codespaces cannot detect USB devices plugged into your machine, which makes development on a physical device impossible.</li><li>Codespaces, like other Linux environments, doesn't support iOS development.</li></ul> | You can use local VS Code for Flutter development. |
|
||||
| [LaTeX Workshop](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop) | The extension provides three kinds of features to help with LaTeX authoring: 1) a set of views that surface common commands, 2) a PDF previewer, and 3) language features like snippets and IntelliSense. The extension can be used fairly fully featured, but there are some web or security limitations. | The following workarounds address limitations in the view and previewer feature areas: <ul><li>The views themselves work without issue, but a few of the commands try to launch native applications, like revealing the output folder in the OS file explorer. These do nothing in the web, so using the desktop is an alternative.</li><li>`"latex-workshop.view.pdf.viewer"` - This setting provides a PDF previewer similar to the [Markdown preview](/docs/languages/markdown.md#markdown-preview). You can preview in a browser tab, in a separate PDF viewer, or in a VS Code tab.<br>Only the browser tab is usable in web-based Codespaces. The separate PDF viewer fails silently, and the VS Code tab hits the [Content Security Policy](/api/extension-guides/webview.md#content-security-policy) issue. The VS Code Tab viewer has other features that aren't available due to this limitation.</li></ul> |
|
||||
| [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) | Some Git Graph webview functionality may be limited in Codespaces. For instance, switching between a file from a commit and the Git Graph webview may blank out the webview. | You can use Git Graph fully within VS Code desktop. |
|
||||
| Other [Remote Development extensions](/docs/remote/remote-overview) (WSL, Dev Containers, Remote - SSH) cannot be installed in a Codespace. | The Codespace is already a remote context. | If you'd like to run in another remote context (for example WSL or a remote SSH computer), open VS Code desktop (not connected to a Codespace) and launch one of the other remote extensions. If you'd like to use a [custom dev container](/docs/remote/create-dev-container.md), you can use the same `.devcontainer` in both Codespaces and Dev Containers. |
|
||||
| Other [Remote Development extensions](/docs/remote/remote-overview) (WSL, Dev Containers, Remote - SSH) cannot be installed in a Codespace. | The Codespace is already a remote context. | If you'd like to run in another remote context (for example WSL or a remote SSH computer), open VS Code desktop (not connected to a Codespace) and launch one of the other remote extensions. If you'd like to use a [custom dev container](/docs/devcontainers/create-dev-container.md), you can use the same `.devcontainer` in both Codespaces and Dev Containers. |
|
||||
| **My_Favorite_Extension** doesn't work and isn't listed above. | There are a few other issues that can prevent features from working as expected in remote contexts. | In some cases, you can use another command to work around the issue, but in others, the extension may need to be modified. Check out the [remote extension tips](/docs/remote/troubleshooting.md#extension-tips) for common remote issues and tips on resolving them. |
|
||||
|
||||
## Common questions
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
Order: 3
|
||||
Area: remote
|
||||
TOCTitle: Dev Containers
|
||||
PageTitle: Developing inside a Container using Visual Studio Code Remote Development
|
||||
ContentId: 4f0942be-6808-4252-8940-b9e9688792af
|
||||
MetaDescription: Developing inside a Container using Visual Studio Code Remote Development
|
||||
DateApproved: 10/6/2022
|
||||
---
|
||||
# Dev Containers
|
||||
|
||||
This page is redirected to /docs/devcontainers/containers.md and only exists to keep the "Dev Containers" TOC item.
|
||||
|
|
@ -9,7 +9,7 @@ DateApproved: 10/6/2022
|
|||
---
|
||||
# Remote Development FAQ
|
||||
|
||||
This article covers frequently asked questions for each of the **Visual Studio Code Remote Development** extensions. See the [SSH](/docs/remote/ssh.md), [Containers](/docs/remote/containers.md), and [WSL](/docs/remote/wsl.md) articles for more details on setting up and working with each of their respective capabilities. Or try the introductory [Tutorials](/docs/remote/ssh-tutorial.md) to help get you running quickly in a remote environment.
|
||||
This article covers frequently asked questions for each of the **Visual Studio Code Remote Development** extensions. See the [SSH](/docs/remote/ssh.md), [Containers](/docs/devcontainers/containers.md), and [WSL](/docs/remote/wsl.md) articles for more details on setting up and working with each of their respective capabilities. Or try the introductory [Tutorials](/docs/remote/ssh-tutorial.md) to help get you running quickly in a remote environment.
|
||||
|
||||
For questions about [GitHub Codespaces](https://github.com/features/codespaces), see the [GitHub Codespaces documentation](https://docs.github.com/github/developing-online-with-codespaces).
|
||||
|
||||
|
@ -91,13 +91,13 @@ You can use one of the following solutions to resolve this problem:
|
|||
|
||||
* Open a new local window (**File > New Window**) and use it to work with local containers.
|
||||
|
||||
* Install the [Dev Containers](https://aka.ms/vscode-remote/download/containers) extension and use the [Remote Explorer](/docs/remote/containers.md#managing-containers) in situations when you need to see your local containers.
|
||||
* Install the [Dev Containers](https://aka.ms/vscode-remote/download/containers) extension and use the [Remote Explorer](/docs/devcontainers/containers.md#managing-containers) in situations when you need to see your local containers.
|
||||
|
||||
* **WSL only**: Use the [Docker Technical Preview for WSL 2](https://docs.docker.com/docker-for-windows/wsl-tech-preview/) or [configure Docker Desktop for use in WSL 1](https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly).
|
||||
|
||||
* **Dev Containers only**: Forward the [Docker socket and install the Docker CLI](https://aka.ms/vscode-remote/samples/docker-from-docker) (only) in the container.
|
||||
|
||||
* Use the [extensionKind property](/docs/remote/containers.md#advanced-forcing-an-extension-to-run-locally-or-remotely) to force the extension to be `ui`. However, this will prevent some commands from working.
|
||||
* Use the [extensionKind property](/docs/devcontainers/containers.md#advanced-forcing-an-extension-to-run-locally-or-remotely) to force the extension to be `ui`. However, this will prevent some commands from working.
|
||||
|
||||
### What Linux packages or libraries need to be installed on a host to use Remote Development?
|
||||
|
||||
|
@ -119,7 +119,7 @@ Yes. The [Remote Development extension pack](https://aka.ms/vscode-remote/downlo
|
|||
|
||||
As with [other parts of Visual Studio Code](/docs/getstarted/settings.md), you can customize each of the Remote Development extensions through their settings. Using Dev Containers as an example, you may review a list of all Dev Containers settings by opening the extension in the Extensions view (`kb(workbench.view.extensions)`), and navigating to **Feature Contributions**:
|
||||
|
||||
![List of settings in Feature Contributions](images/containers/feature-contributions.png)
|
||||
![List of settings in Feature Contributions](images/faq/feature-contributions.png)
|
||||
|
||||
## WSL
|
||||
|
||||
|
@ -135,18 +135,6 @@ We decided instead to make parts of VS Code run in WSL and let the UI running on
|
|||
|
||||
With this approach, language features like smart completions just work against what is in WSL without having to set up anything on Windows. You don't have to worry about path issues or set up different versions of development stacks on Windows. If you are deploying applications to Linux, you can set up your WSL instances to look like your runtime environment while still getting a rich editing experience on Windows.
|
||||
|
||||
## Dev Containers
|
||||
|
||||
### Do "dev container definitions" define how an application is deployed?
|
||||
|
||||
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 [vscode-dev-containers repository](https://aka.ms/vscode-dev-containers) includes a set of dev container definitions for some common development environments. You can also [attach to a running container](/docs/remote/attach-container.md) without setting up a dev container definition, if you prefer to use an alternate container build or deployment workflow.
|
||||
|
||||
### Do "dev containers definitions" define how an application is built? Like Buildpacks?
|
||||
|
||||
No. The [Buildpacks](https://buildpacks.io/) 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.
|
||||
|
||||
## Extensions authors
|
||||
|
||||
### As an extension author, what do I need to do?
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6726ccb95a63e46c0333f3f49a0ef12c6f94f41bf329584e84034982fedd6e67
|
||||
size 18394
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aa6b3ac2c84edff7a9e60b32822c028e909d909605781099fa9daa32b3bcfd10
|
||||
size 27419
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3988470d12f956ff993430f068f631431b81615f88e8179eb7ed880c3831ed0d
|
||||
size 28690
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:935f50aebf7cf5396b0e5f9a22afefeea169197c91a3649215f7792dd4079cc7
|
||||
size 30800
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3befabadfa16394316db75dfa4f5ac8d3e80da06c8a30a95538cc1f87ea3bd6b
|
||||
size 6177
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:07502734f23e36fcffa9da82bd568bcaee8dda747dbb75643e4b175d3f647b81
|
||||
size 20872
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1d1df279de9ce27d30eb1b98722990866c6f3fb90365d3c31094088253f6eac1
|
||||
size 9443
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dcc5edef92b059d43c8944ea9252ca069b0b3642bea4b01ca7b2b2dee85ab38f
|
||||
size 20065
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:237b55985efde8a2fcd58b921f1e15445f9ecff2b8dacb6565b0cc11caed87ed
|
||||
size 31178
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b46b9ffe3d4c12906781d5f1f8a120c76af01a034dcda1ada243b298895a1103
|
||||
size 8226
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0bbbf53b0146f3327ef313ec236e0a0c97515b7c50ed6ecdc3fe55d3a0e74765
|
||||
size 35405
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0b3614b767357f1b98f1cd8d525e02358db14228c94b623e332c930eb57a4ee3
|
||||
size 3687
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3aedbc1dfe513b56b3903fb72c6f8d27b400fbe940e8f27be450b8049a0856a6
|
||||
size 15777
|
|
@ -157,7 +157,7 @@ RUN wget -q https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6
|
|||
|
||||
## Questions or feedback
|
||||
|
||||
* See [Tips and Tricks](/docs/remote/troubleshooting.md#container-tips) or the [FAQ](/docs/remote/faq.md).
|
||||
* See [Tips and Tricks](/docs/remote/troubleshooting.md) or the [FAQ](/docs/remote/faq.md).
|
||||
* Search on [Stack Overflow](https://stackoverflow.com/questions/tagged/vscode-remote).
|
||||
* Add a [feature request](https://aka.ms/vscode-remote/feature-requests) or [report a problem](https://aka.ms/vscode-remote/issues/new).
|
||||
* Create a [development container definition](https://aka.ms/vscode-dev-containers) for others to use.
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче