Skip to content

Commit ceda72b

Browse files
authored
Docker content refresh (#5866)
* update overview.md * quickstart refresh * refresh articles * refresh docker compose * refresh pass * refresh dates * Update docs/containers/docker-compose.md
1 parent c9afa4e commit ceda72b

21 files changed

+77
-81
lines changed

docs/containers/bridge-to-kubernetes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Area: containers
44
TOCTitle: Develop with Kubernetes
55
ContentId: 80bd336b-0d2d-4d63-a771-8b3ea22a64d3
66
PageTitle: Use Bridge to Kubernetes to run and debug locally with Kubernetes
7-
DateApproved: 12/7/2022
7+
DateApproved: 12/21/2022
88
MetaDescription: Learn how to use Bridge to Kubernetes.
99
---
1010

docs/containers/debug-common.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Area: containers
44
TOCTitle: Debug
55
ContentId: A1371726-5310-4923-B43B-240F36C6264E
66
PageTitle: Debug an app running in a Docker container
7-
DateApproved: 7/16/2021
7+
DateApproved: 12/21/2022
88
MetaDescription: Debug an app running in a Docker container, using Visual Studio Code.
99
---
1010
# Debug containerized apps
1111

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.
1313

1414
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.
1515

@@ -33,13 +33,13 @@ Example `launch.json` configuration for debugging a Node.js application:
3333

3434
```json
3535
{
36-
"version": "0.2.0",
3736
"configurations": [
37+
3838
{
39-
"name": "Launch Node.js in Docker",
39+
"name": "Docker Node.js Launch",
4040
"type": "docker",
4141
"request": "launch",
42-
"preLaunchTask": "Run Docker Container",
42+
"preLaunchTask": "docker-run: debug",
4343
"platform": "node"
4444
}
4545
]
@@ -78,8 +78,6 @@ Example `launch.json` configuration for debugging a Python application:
7878

7979
More information about debugging .NET applications within Docker containers can be found in [Debug .NET within Docker containers](/docs/containers/debug-netcore.md).
8080

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-
8381
Example `launch.json` configuration for debugging a .NET application:
8482

8583
```json

docs/containers/debug-netcore.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Area: containers
33
ContentId: B1DF33C0-400C-413D-B60B-D1AA278F6DE3
44
PageTitle: Debug a .NET app running in a Docker container
5-
DateApproved: 4/15/2021
5+
DateApproved: 12/21/2022
66
MetaDescription: Debug a .NET app running in a Docker container, using Visual Studio Code.
77
---
88
# Debug .NET within a container

docs/containers/debug-node.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Area: containers
33
ContentId: F0C800DD-C477-492D-9545-745F570FE042
44
PageTitle: Configure and troubleshoot debugging of Node.js apps running in a Docker container
5-
DateApproved: 9/23/2020
5+
DateApproved: 12/21/2022
66
MetaDescription: How to configure and troubleshoot debugging of Node.js apps running in a Docker container, using Visual Studio Code.
77
---
88

@@ -117,8 +117,7 @@ Also note that the `debug` logger writes logs only when enabled via the `DEBUG`
117117

118118
### Configuring when the application is "ready"
119119

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.
122121

123122
For example, suppose the application logs the following message:
124123

@@ -210,7 +209,7 @@ Dockerfiles are often arranged in such a way as to optimize either image build t
210209
The solution is to remove that optimization from the `Dockerfile`:
211210

212211
```docker
213-
FROM node:10.13-alpine
212+
FROM node:lts-alpine
214213
ENV NODE_ENV=production
215214
WORKDIR /usr/src/app
216215
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
@@ -219,5 +218,7 @@ COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
219218
RUN npm install --production --silent
220219
COPY . .
221220
EXPOSE 3000
222-
CMD npm start
221+
RUN chown -R node /usr/src/app
222+
USER node
223+
CMD ["npm", "start"]
223224
```

docs/containers/debug-python.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Area: containers
33
ContentId: f9ffec31-9253-4f71-a4eb-79ea7b3a8f55
44
PageTitle: Configure and troubleshoot debugging of Python apps running in a Docker container
5-
DateApproved: 7/26/2021
5+
DateApproved: 12/21/2021
66
MetaDescription: How to configure and troubleshoot debugging of Python apps running in a Docker container, using Visual Studio Code.
77
---
88

@@ -104,7 +104,6 @@ Here is an example of using `dockerServerReadyAction` to launch the browser to o
104104
- `action`: The action to take when the pattern is found. Can be `debugWithChrome` or `openExternally`.
105105

106106
- `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-
108107
- `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.
109108

110109
## 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
119118
#ADD . /app
120119
```
121120
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.
123122
124123
``` json
125124
{
@@ -173,7 +172,7 @@ When you select **Docker: Add Docker Files to Workspace** for Django or Flask, w
173172
#ADD . /app
174173
```
175174
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.
177176
178177
``` json
179178
{
@@ -250,7 +249,7 @@ When you select **Docker: Add Docker Files to Workspace** for Django or Flask, w
250249
]
251250
```
252251

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.
254253

255254
1. The `dockerBuild` object in the JSON allows for the following parameters:
256255

docs/containers/docker-compose.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Area: containers
44
TOCTitle: Docker Compose
55
ContentId: c63d86a0-48f8-4724-ba24-fa5ce4199632
66
PageTitle: Use Docker Compose to work with multiple containers
7-
DateApproved: 7/16/2021
7+
DateApproved: 12/21/2022
88
MetaDescription: Develop a multi-container app running in a Docker containers using Docker Compose and Visual Studio Code.
99
---
1010
# Use Docker Compose
@@ -33,7 +33,7 @@ With the docker-compose files, you can now specify port mappings in the docker-c
3333
3434
## Add new containers to your projects
3535

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.
3737

3838
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.
3939

@@ -76,7 +76,7 @@ Create an **Attach** [launch configuration](/docs/editor/debugging.md#launch-con
7676
command: node --inspect=0.0.0.0:9229 ./bin/www
7777
```
7878
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.
8080

8181
Here's an example that shows the Node.js launch configuration - Attach:
8282

@@ -111,7 +111,7 @@ For debugging Python with Docker Compose, follow these steps:
111111

112112
![Screenshot of Python Remote Attach](images/compose/docker-compose-python-remote-attach.png)
113113

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.
115115

116116
```json
117117
"configurations": [
@@ -226,7 +226,7 @@ Workspaces can have multiple docker-compose files to handle different environmen
226226

227227
### Base file and an override file
228228

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.
230230

231231
```json
232232
"docker.commands.composeUp": [
@@ -239,7 +239,7 @@ Let's assume your workspace has a base compose file (`docker-compose.yml`) and a
239239

240240
### Template matching
241241

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.
243243

244244
```json
245245
"docker.commands.composeUp": [
@@ -263,7 +263,7 @@ Let's assume you have different set of input files for each environment. You co
263263

264264
### Pick a template when the command is invoked
265265

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:
267267

268268
```json
269269
"docker.commands.composeUp": [
@@ -284,7 +284,7 @@ If you omit the `match` property from command templates, you will be asked which
284284

285285
## Custom tasks
286286

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.
288288

289289
```json
290290
{
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

docs/containers/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Area: containers
44
TOCTitle: Overview
55
ContentId: 4B462667-8915-4BE0-B8D0-EDE51CB2D273
66
PageTitle: Docker extension for Visual Studio Code
7-
DateApproved: 11/3/2021
7+
DateApproved: 12/13/2022
88
MetaDescription: Tools for developing and debugging with Docker containers, using Visual Studio Code.
99
---
1010
# Docker in Visual Studio Code
@@ -25,7 +25,7 @@ To install the extension, open the Extensions view (`kb(workbench.view.extension
2525

2626
## Editing Docker files
2727

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.
2929

3030
![IntelliSense for Dockerfiles](images/overview/dockerfile-intellisense.png)
3131

@@ -81,7 +81,7 @@ You can display the content and push, pull, or delete images from [Azure Contain
8181

8282
![Azure Container Registry content](images/overview/container-registry.png)
8383

84-
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).
8585

8686
## Debugging services running inside a container
8787

0 commit comments

Comments
 (0)