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/docker-compose-properties.md
+27-9Lines changed: 27 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ author: ghogen
4
4
description: Learn how to edit the Docker Compose build properties to customize how Visual Studio builds and runs a Docker Compose application.
5
5
ms.custom: SEO-VS-2020
6
6
ms.author: ghogen
7
-
ms.date: 08/12/2019
7
+
ms.date: 04/06/2021
8
8
ms.technology: vs-azure
9
9
ms.topic: reference
10
10
---
@@ -37,7 +37,7 @@ The following table shows the MSBuild properties available for Docker Compose pr
37
37
|DockerComposeProjectName| dcproj | If specified, overrides the project name for a docker-compose project. | "dockercompose" + auto-generated hash |
38
38
|DockerComposeProjectPath|csproj or vbproj|The relative path to the docker-compose project (dcproj) file. Set this property when publishing the service project to find the associated image build settings stored in the docker-compose.yml file.|-|
39
39
|DockerComposeUpArguments|dcproj|Specifies the extra parameters to pass to the `docker-compose up` command. For example, `--timeout 500`|-|
40
-
|DockerDevelopmentMode|dcproj| Controls whether "build-on-host" optimization ("Fast Mode" debugging) is enabled. Allowed values are **Fast** and **Regular**. | Fast |
40
+
|DockerDevelopmentMode|dcproj| Controls whether "build-on-host" optimization ("Fast Mode" debugging) is enabled. Allowed values are `Fast` and `Regular`. |`Fast` in the Debug configuration or `Regular` in all other configurations|
41
41
|DockerLaunchAction| dcproj | Specifies the launch action to perform on F5 or Ctrl+F5. Allowed values are None, LaunchBrowser, and LaunchWCFTestClient.|None|
42
42
|DockerLaunchBrowser| dcproj | Indicates whether to launch the browser. Ignored if DockerLaunchAction is specified. | False |
43
43
|DockerServiceName| dcproj|If DockerLaunchAction or DockerLaunchBrowser are specified, then DockerServiceName is the name of the service that should be launched. Use this property to determine which of the potentially many projects that a docker-compose file can reference will be launched.|-|
@@ -87,9 +87,16 @@ services:
87
87
> [!NOTE]
88
88
> DockerComposeBuildArguments, DockerComposeDownArguments, and DockerComposeUpArguments are new in Visual Studio 2019 version 16.3.
You can also override certain settings by placing a file named *docker-compose.vs.debug.yml* (for **Debug** configuration) or *docker-compose.vs.release.yml* (for **Release** configuration) in the same directory as your *docker-compose.yml* file. In this file, you can specify settings as follows:
92
+
You can override certain settings by placing a file named *docker-compose.vs.debug.yml* (for **Fast** mode) or *docker-compose.vs.release.yml* (for **Regular** mode) in the same directory as your *docker-compose.yml* file.
93
+
94
+
>[!TIP]
95
+
>To find out the default values for any of these settings, look in *docker-compose.vs.debug.g.yml* or *docker-compose.vs.release.g.yml*.
96
+
97
+
### Docker Compose file labels
98
+
99
+
In *docker-compose.vs.debug.yml* or *docker-compose.vs.release.yml*, you can define override-specific labels as follows:
93
100
94
101
```yml
95
102
services:
@@ -103,23 +110,34 @@ Use double quotes around the values, as in the preceding example, and use the ba
103
110
|Label name|Description|
104
111
|----------|-----------|
105
112
|com.microsoft.visualstudio.debuggee.arguments|The arguments passed to the program when starting debugging. For .NET Core apps, these arguments are typically additional search paths for NuGet packages followed by the path to the project's output assembly.|
106
-
|com.microsoft.visualstudio.debuggee.killprogram|This command is used to stop the debuggee program that's running inside of the container (when necessary).|
107
113
|com.microsoft.visualstudio.debuggee.program|The program launched when starting debugging. For .NET Core apps, this setting is typically **dotnet**.|
108
114
|com.microsoft.visualstudio.debuggee.workingdirectory|The directory used as the starting directory when starting debugging. This setting is typically */app* for Linux containers, or *C:\app* for Windows containers.|
115
+
|com.microsoft.visualstudio.debuggee.killprogram|This command is used to stop the debuggee program that's running inside of the container (when necessary).|
109
116
110
-
## Customize the app startup process
117
+
### Customize the Docker build process
111
118
112
-
You can run a command or custom script before launching your app by using the `entrypoint` setting, and making it dependent on the configuration. For example, if you need to set up a certificate only in **Debug** mode by running `update-ca-certificates`, but not in **Release** mode, you could add the following code only in *docker-compose.vs.debug.yml*:
119
+
You can declare which stage to build in your Dockerfile by using the `target` setting in the `build` property. This override can be used in only the *docker-compose.vs.debug.yml* or *docker-compose.vs.release.yml*
If you omit the *docker-compose.vs.release.yml* or *docker-compose.vs.debug.yml* then Visual Studio generates one based on default settings.
130
+
### Customize the app startup process
131
+
132
+
You can run a command or custom script before launching your app by using the `entrypoint` setting, and making it dependent on the `DockerDevelopmentMode`. For example, if you need to set up a certificate only in **Fast** mode by running `update-ca-certificates`, but not in **Regular** mode, you could add the following code in **only** *docker-compose.vs.debug.yml*:
0 commit comments