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: eng/docker-tools/DEV-GUIDE.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,28 @@ The stages variable is useful for:
198
198
- Skipping tests during initial development
199
199
- Running isolated stages for debugging
200
200
201
+
### Decoupling build OS from the base image OS
202
+
203
+
By default, a platform's `osVersion` represents the base image OS version, but also determines what
204
+
build leg an image is built in. This can cause problems when build image and base image don't match
205
+
up. For example, building a .NET app on Windows Server 2025 and copying the artifacts into a
206
+
Windows Server 2019 base image won't work, because the build matrix generation will attempt to
207
+
build the image on the Server 2019 build leg (which can't run Server 2025 images).
208
+
209
+
To fix this, set the optional `buildOsVersion` field in order to override only the OS used in the
210
+
build matrix generation. Here is an example of building a Windows Server 2019 image using Windows
211
+
Server 2025:
212
+
213
+
```jsonc
214
+
{
215
+
// ...
216
+
"os": "windows",
217
+
"osVersion": "windowsservercore-ltsc2019",
218
+
"buildOsVersion": "windowsservercore-ltsc2025"
219
+
// ...
220
+
}
221
+
```
222
+
201
223
### Image Info Files: The Build's Memory
202
224
203
225
Image info files (defined by [`ImageArtifactDetails`](https://github.com/dotnet/docker-tools/blob/main/src/ImageBuilder/Models/Image/ImageArtifactDetails.cs)) are the mechanism that tracks what was built:
0 commit comments