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
> For a list of workloads and components, see the [Visual Studio Build Tools component directory](workload-component-id-vs-build-tools.md).
181
+
>
182
+
183
+
> [!WARNING]
184
+
> If you base your image directly on microsoft/windowsservercore, the .NET Framework might not install properly and no install error is indicated. Managed code might not run after the install is complete. Instead, base your image on [microsoft/dotnet-framework:4.8](https://hub.docker.com/r/microsoft/dotnet-framework) or later. Also note that images that are tagged version 4.8 or later might use PowerShell as the default `SHELL`, which will cause the `RUN` and `ENTRYPOINT` instructions to fail.
185
+
>
186
+
> See [Windows container version compatibility](/virtualization/windowscontainers/deploy-containers/version-compatibility) to see which container OS versions are supported on which host OS versions, and [Known issues for containers](build-tools-container-issues.md) for known issues.
187
+
188
+
::: moniker-end
146
189
> [!NOTE]
147
190
> Error code `3010` is used to indicate success with a reboot required, see [MsiExec.exe error messages](/windows/win32/msi/error-codes) for more information.
148
191
@@ -160,7 +203,7 @@ Save the following example Dockerfile to a new file on your disk. If the file is
160
203
161
204
::: moniker-end
162
205
163
-
::: moniker range=">=vs-2019"
206
+
::: moniker range="vs-2019"
164
207
165
208
```shell
166
209
docker build -t buildtools2019:latest -m 2GB .
@@ -172,6 +215,18 @@ Save the following example Dockerfile to a new file on your disk. If the file is
172
215
173
216
::: moniker-end
174
217
218
+
::: moniker range=">=vs-2022"
219
+
220
+
```shell
221
+
docker build -t buildtools:latest -m 2GB .
222
+
```
223
+
224
+
This command builds the Dockerfile in the current directory using 2 GB of memory. The default 1 GB is not sufficient when some workloads are installed; however, you might be able to build with only 1 GB of memory depending on your build requirements.
225
+
226
+
The final image is tagged "buildtools:latest" so you can easily run it in a container as "buildtools" since the "latest" tag is the default if no tag is specified. If you want to use a specific version of Visual Studio Build Tools in a more [advanced scenario](advanced-build-tools-container.md), you might instead tag the container with a specific Visual Studio build number as well as "latest" so containers can use a specific version consistently.
227
+
228
+
::: moniker-end
229
+
175
230
## Using the built image
176
231
177
232
Now that you have created an image, you can run it in a container to do both interactive and automated builds. The example uses the Developer Command Prompt, so your PATH and other environment variables are already configured.
@@ -188,14 +243,22 @@ Now that you have created an image, you can run it in a container to do both int
188
243
189
244
::: moniker-end
190
245
191
-
::: moniker range=">=vs-2019"
246
+
::: moniker range="vs-2019"
192
247
193
248
```shell
194
249
docker run -it buildtools2019
195
250
```
196
251
197
252
::: moniker-end
198
253
254
+
::: moniker range=">=vs-2022"
255
+
256
+
```shell
257
+
docker run -it buildtools
258
+
```
259
+
260
+
::: moniker-end
261
+
199
262
To use this image for your CI/CD workflow, you can publish it to your own [Azure Container Registry](https://azure.microsoft.com/services/container-registry) or other internal [Docker registry](https://docs.docker.com/registry/deploying) so servers need only to pull it.
0 commit comments