You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/containers/debug-common.md
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ Area: containers
4
4
TOCTitle: Debug
5
5
ContentId: A1371726-5310-4923-B43B-240F36C6264E
6
6
PageTitle: Debug an app running in a Docker container
7
-
DateApproved: 7/16/2021
7
+
DateApproved: 12/21/2022
8
8
MetaDescription: Debug an app running in a Docker container, using Visual Studio Code.
9
9
---
10
10
# Debug containerized apps
11
11
12
-
With version 0.9.0 and later, the Docker extension provides more support for debugging applications within Docker containers, such as scaffolding `launch.json` configurations for attaching a debugger to applications running within a container.
12
+
The Docker extension provides more support for debugging applications within Docker containers, such as scaffolding `launch.json` configurations for attaching a debugger to applications running within a container.
13
13
14
14
The Docker extension provides a `docker` debug configuration provider that manages how VS Code will launch an application and/or attach a debugger to the application in a running Docker container. This provider is configured via entries within `launch.json`, with configuration being specific to each application platform supported by the provider.
15
15
@@ -33,13 +33,13 @@ Example `launch.json` configuration for debugging a Node.js application:
33
33
34
34
```json
35
35
{
36
-
"version": "0.2.0",
37
36
"configurations": [
37
+
38
38
{
39
-
"name": "Launch Node.js in Docker",
39
+
"name": "Docker Node.js Launch",
40
40
"type": "docker",
41
41
"request": "launch",
42
-
"preLaunchTask": "Run Docker Container",
42
+
"preLaunchTask": "docker-run: debug",
43
43
"platform": "node"
44
44
}
45
45
]
@@ -78,8 +78,6 @@ Example `launch.json` configuration for debugging a Python application:
78
78
79
79
More information about debugging .NET applications within Docker containers can be found in [Debug .NET within Docker containers](/docs/containers/debug-netcore.md).
80
80
81
-
> The previous (Preview) .NET Docker debugging support (utilizing `"type": "docker-coreclr"` instead of the current preview's `"type": "docker"`) is being deprecated. You can still find documentation on that support at [Debug .NET Core - Deprecated](https://github.com/microsoft/vscode-docker/wiki/Debug-NetCore-Deprecated).
82
-
83
81
Example `launch.json` configuration for debugging a .NET application:
Copy file name to clipboardExpand all lines: docs/containers/debug-node.md
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
Area: containers
3
3
ContentId: F0C800DD-C477-492D-9545-745F570FE042
4
4
PageTitle: Configure and troubleshoot debugging of Node.js apps running in a Docker container
5
-
DateApproved: 9/23/2020
5
+
DateApproved: 12/21/2022
6
6
MetaDescription: How to configure and troubleshoot debugging of Node.js apps running in a Docker container, using Visual Studio Code.
7
7
---
8
8
@@ -117,8 +117,7 @@ Also note that the `debug` logger writes logs only when enabled via the `DEBUG`
117
117
118
118
### Configuring when the application is "ready"
119
119
120
-
The extension determines the application is "ready" to receive HTTP connections when it writes a message of the form `Listening on port <number>` to the debug console, as Express.js does by default. If the application logs a different
121
-
message, then you should set the `pattern` property of the [dockerServerReadyAction](/docs/containers/debug-common.md#dockerserverreadyaction-object-properties) object of the debug launch configuration to a [JavaScript regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions) that matches that message. The regular expression should include a capture group that corresponds to the port on which the application is listening.
120
+
The extension determines the application is "ready" to receive HTTP connections when it writes a message of the form `Listening on port <number>` to the debug console, as Express.js does by default. If the application logs a different message, then you should set the `pattern` property of the [dockerServerReadyAction](/docs/containers/debug-common.md#dockerserverreadyaction-object-properties) object of the debug launch configuration to a [JavaScript regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions) that matches that message. The regular expression should include a capture group that corresponds to the port on which the application is listening.
122
121
123
122
For example, suppose the application logs the following message:
124
123
@@ -210,7 +209,7 @@ Dockerfiles are often arranged in such a way as to optimize either image build t
210
209
The solution is to remove that optimization from the `Dockerfile`:
Copy file name to clipboardExpand all lines: docs/containers/debug-python.md
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
Area: containers
3
3
ContentId: f9ffec31-9253-4f71-a4eb-79ea7b3a8f55
4
4
PageTitle: Configure and troubleshoot debugging of Python apps running in a Docker container
5
-
DateApproved: 7/26/2021
5
+
DateApproved: 12/21/2021
6
6
MetaDescription: How to configure and troubleshoot debugging of Python apps running in a Docker container, using Visual Studio Code.
7
7
---
8
8
@@ -104,7 +104,6 @@ Here is an example of using `dockerServerReadyAction` to launch the browser to o
104
104
-`action`: The action to take when the pattern is found. Can be `debugWithChrome` or `openExternally`.
105
105
106
106
-`pattern`: If the application logs a different message than shown above, set the `pattern` property of the [dockerServerReadyAction](/docs/containers/debug-common.md#dockerserverreadyaction-object-properties) object to a [JavaScript regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions) that matches that message. The regular expression should include a capture group that corresponds to the port on which the application is listening.
107
-
108
107
-`uriFormat`: By default, the Docker extension will open the main page of the browser (however that is determined by the application). If you want the browser to open a specific page like the example above, the `uriFormat` property of the [dockerServerReadyAction](/docs/containers/debug-common.md#dockerserverreadyaction-object-properties) object should be set to a format string with two string tokens to indicate the protocol and port substitution.
109
108
110
109
## How to enable hot reloading in Django or Flask apps
@@ -119,7 +118,7 @@ When you select **Docker: Add Docker Files to Workspace** for Django or Flask, w
119
118
#ADD . /app
120
119
```
121
120
122
-
1. Within the `docker-run` task in the `tasks.json` file, create a new dockerRun attribute with a `volumes` property. This will create a mapping from the current workspace folder (app code) to the `/app` folder in the container.
121
+
1. Within the `docker-run` task in the `tasks.json` file, create a new `dockerRun` attribute with a `volumes` property. This setting creates a mapping from the current workspace folder (app code) to the `/app` folder in the container.
123
122
124
123
``` json
125
124
{
@@ -173,7 +172,7 @@ When you select **Docker: Add Docker Files to Workspace** for Django or Flask, w
173
172
#ADD . /app
174
173
```
175
174
176
-
1. Within the `docker-run` task in the `tasks.json` file, edit the existing dockerRun attribute by adding a `FLASK_ENV` in the `env` property as well as a `volumes` property. This will create a mapping from the current workspace folder (app code) to the `/app` folder in the container.
175
+
1. Within the `docker-run` task in the `tasks.json` file, edit the existing dockerRun attribute by adding a `FLASK_ENV` in the `env` property as well as a `volumes` property. This setting creates a mapping from the current workspace folder (app code) to the `/app` folder in the container.
177
176
178
177
``` json
179
178
{
@@ -250,7 +249,7 @@ When you select **Docker: Add Docker Files to Workspace** for Django or Flask, w
250
249
]
251
250
```
252
251
253
-
**Tip:** As the dependency clearly states `docker-build` as its dependency, the name has to match this task. It can be changed to anything though.
252
+
**Tip:** As the dependency clearly states `docker-build` as its dependency, the name has to match this task. You can change the name, if desired.
254
253
255
254
1. The `dockerBuild` object in the JSON allows for the following parameters:
Copy file name to clipboardExpand all lines: docs/containers/docker-compose.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Area: containers
4
4
TOCTitle: Docker Compose
5
5
ContentId: c63d86a0-48f8-4724-ba24-fa5ce4199632
6
6
PageTitle: Use Docker Compose to work with multiple containers
7
-
DateApproved: 7/16/2021
7
+
DateApproved: 12/21/2022
8
8
MetaDescription: Develop a multi-container app running in a Docker containers using Docker Compose and Visual Studio Code.
9
9
---
10
10
# Use Docker Compose
@@ -33,7 +33,7 @@ With the docker-compose files, you can now specify port mappings in the docker-c
33
33
34
34
## Add new containers to your projects
35
35
36
-
If you want to add another app or service, you can run **Add Docker Compose Files to Workspace** again, and choose to overwrite the existing docker-compose files, but you'll lose any customization in those files. If you want to preserve changes to the compose files, you can manually modify the `docker-compose.yml` file to add the new service. Typically, you can cut and paste the existing service section and change the names as appropriate for the new service.
36
+
If you want to add another app or service, you can run **Add Docker Compose Files to Workspace** again, and choose to overwrite the existing docker-compose files, but you'll lose any customization in those files. If you want to preserve changes to the compose files, you can manually modify the `docker-compose.yml` file to add the new service. Typically, you can copy the existing service section, paste it to create a new entry, and change the names as appropriate for the new service.
37
37
38
38
You can run the **Add Docker Files to Workspace** command again to generate the `Dockerfile` for a new app. While each app or service has its own Dockerfile, there's typically one `docker-compose.yml` and one `docker-compose.debug.yml` file per workspace.
39
39
@@ -76,7 +76,7 @@ Create an **Attach** [launch configuration](/docs/editor/debugging.md#launch-con
76
76
command: node --inspect=0.0.0.0:9229 ./bin/www
77
77
```
78
78
79
-
1. If you have multiple apps, you need to change the port for one of them, so that each app has a unique port. You can point to the right debugging port in the `launch.json`, and save the file. If you omit this, the port will be chosen automatically.
79
+
1. If you have multiple apps, you need to change the port for some of them, so that each app has a unique port. You can point to the right debugging port in the `launch.json`, and save the file. If you omit this, the port will be chosen automatically.
80
80
81
81
Here's an example that shows the Node.js launch configuration - Attach:
82
82
@@ -111,7 +111,7 @@ For debugging Python with Docker Compose, follow these steps:
111
111
112
112

113
113
114
-
1. You'll be prompted to choose the host machine (for example, localhost) and port you want to use for debugging. The default debugging port for Python is 5678. If you have multiple apps, you need to change the port for one of them, so that each app has a unique port. You can point to the right debugging port in the `launch.json`, and save the file. If you omit this, the port will be chosen automatically.
114
+
1. You're prompted to choose the host machine (for example, localhost) and port you want to use for debugging. The default debugging port for Python is 5678. If you have multiple apps, you need to change the port for one of them, so that each app has a unique port. You can point to the right debugging port in the `launch.json`, and save the file. If you omit this, the port will be chosen automatically.
115
115
116
116
```json
117
117
"configurations": [
@@ -226,7 +226,7 @@ Workspaces can have multiple docker-compose files to handle different environmen
226
226
227
227
### Base file and an override file
228
228
229
-
Let's assume your workspace has a base compose file (`docker-compose.yml`) and an override file for each environment (`docker-compose.dev.yml`, `docker-compose.test.yml` and `docker-compose.prod.yml`) and you always compose up with the base file and an override file. In this case, the `compose up` command can be customized as in the following example. When the `compose up` command is invoked, the `${configurationFile}` is replaced by the selected file.
229
+
Let's assume your workspace has a base compose file (`docker-compose.yml`) and an override file for each environment (`docker-compose.dev.yml`, `docker-compose.test.yml` and `docker-compose.prod.yml`) and you always run `docker compose up` with the base file and an override file. In this case, the `compose up` command can be customized as in the following example. When the `compose up` command is invoked, the `${configurationFile}` is replaced by the selected file.
230
230
231
231
```json
232
232
"docker.commands.composeUp": [
@@ -239,7 +239,7 @@ Let's assume your workspace has a base compose file (`docker-compose.yml`) and a
239
239
240
240
### Template matching
241
241
242
-
Let's assume you have different set of input files for each environment. You could define multiple templates with regular expression match, and the selected file name will be matched against this `match` property and the corresponding template will be used.
242
+
Let's assume you have a different set of input files for each environment. You could define multiple templates with regular expression match, and the selected file name will be matched against this `match` property and the corresponding template will be used.
243
243
244
244
```json
245
245
"docker.commands.composeUp": [
@@ -263,7 +263,7 @@ Let's assume you have different set of input files for each environment. You co
263
263
264
264
### Pick a template when the command is invoked
265
265
266
-
If you omit the `match` property from command templates, you will be asked which template to use each time `compose up` command is invoked. For example:
266
+
If you omit the `match` property from command templates, you're asked which template to use each time `compose up` command is invoked. For example:
267
267
268
268
```json
269
269
"docker.commands.composeUp": [
@@ -284,7 +284,7 @@ If you omit the `match` property from command templates, you will be asked which
284
284
285
285
## Custom tasks
286
286
287
-
Rather than use command customization, you can also define a task like the following to invoke a `docker-compose` command. Please refer [custom task](/docs/editor/tasks.md#custom-tasks) for more detail on this.
287
+
Rather than use command customization, you can also define a task like the following to invoke a `docker-compose` command. Please refer [custom task](/docs/editor/tasks.md#custom-tasks) for more detail on this option.
Copy file name to clipboardExpand all lines: docs/containers/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Area: containers
4
4
TOCTitle: Overview
5
5
ContentId: 4B462667-8915-4BE0-B8D0-EDE51CB2D273
6
6
PageTitle: Docker extension for Visual Studio Code
7
-
DateApproved: 11/3/2021
7
+
DateApproved: 12/13/2022
8
8
MetaDescription: Tools for developing and debugging with Docker containers, using Visual Studio Code.
9
9
---
10
10
# Docker in Visual Studio Code
@@ -25,7 +25,7 @@ To install the extension, open the Extensions view (`kb(workbench.view.extension
25
25
26
26
## Editing Docker files
27
27
28
-
You can get [IntelliSense](/docs/editor/intellisense.md) when editing your `Dockerfile` and `docker-compose.yml` files, with completions and syntax help for common commands.
28
+
You can get [IntelliSense](/docs/editor/intellisense.md)by clicking `kb(editor.action.triggerSuggest)`when editing your `Dockerfile` and `docker-compose.yml` files, with completions and syntax help for common commands.
29
29
30
30

31
31
@@ -81,7 +81,7 @@ You can display the content and push, pull, or delete images from [Azure Contain
An image in an Azure Container Registry can be deployed to Azure App Service directly from VS Code. See [Deploy images to Azure App Service](/docs/containers/app-service.md) to get started. For more information about how to authenticate to and work with registries, see [Using container registries](/docs/containers/quickstart-container-registries.md).
84
+
An image in an Azure Container Registry can be deployed to Azure App Service directly from VS Code. See [Deploy to Azure App Service](/docs/containers/app-service.md) to get started. For more information about how to authenticate to and work with registries, see [Using container registries](/docs/containers/quickstart-container-registries.md).
0 commit comments