Skip to content

Commit 150e183

Browse files
authored
Updates for .NET January 2025 Servicing (#6136)
2 parents 97701fd + 80d129a commit 150e183

File tree

470 files changed

+6113
-10795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

470 files changed

+6113
-10795
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
**/bin
22
**/obj
33
**/out
4-
**/.vscode
54
**/.vs
65
.dotnet
76
.Microsoft.DotNet.ImageBuilder

.github/ISSUE_TEMPLATE/releases/dotnet-release-lifecycle.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ Create announcement:
8282
## EOL
8383

8484
- [ ] Remove EOL .NET version from `main` and `nightly` branches (one issue)
85-
- [ ] Remove all entries for the EOL .NET version in `manifest.json`, `manifest.versions.json`, [ImageVersion.cs](https://github.com/dotnet/dotnet-docker/blob/nightly/tests/Microsoft.DotNet.Docker.Tests/ImageVersion.cs), [TestData.cs](https://github.com/dotnet/dotnet-docker/blob/nightly/tests/Microsoft.DotNet.Docker.Tests/TestData.cs), [MCR tags metadata templates](https://github.com/dotnet/dotnet-docker/tree/main/eng/mcr-tags-metadata-templates), and delete the Dockerfiles
85+
- [ ] Remove all entries for the EOL .NET version in:
86+
- [ ] `manifest.json`
87+
- [ ] `manifest.versions.json`
88+
- [ ] [ImageVersion.cs](/tests/Microsoft.DotNet.Docker.Tests/ImageVersion.cs)
89+
- [ ] [TestData.cs](/tests/Microsoft.DotNet.Docker.Tests/TestData.cs)
90+
- [ ] [mcr-tags-metadata-templates](/eng/mcr-tags-metadata-templates)
91+
- [ ] [Featured tags](/eng/readme-templates/FeaturedTags.md)
92+
- [ ] [Image size tests](/tests/performance)
93+
- [ ] Delete the Dockerfiles
8694
- [ ] Search for and simplify conditions including the EOL .NET Version in the Dockerfile templates and tests
8795
- [ ] Update the path variable appropriately for the [dotnet-docker-nightly-pr-no-cache](https://dev.azure.com/dnceng-public/public/_build?definitionId=184) pipeline so that it continues to target active Dockerfiles.
8896
- [ ] Replace all references to the EOL .NET version in documentation with a new .NET version

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ artifacts/
1313
.vs/
1414

1515
# Visual Studio Code cache/options directory
16-
.vscode/
16+
.vscode/*
17+
!.vscode/tasks.json
18+
!.vscode/launch.json
1719

1820
# Test files
1921
*.trx

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
// Launch configurations documentation: https://go.microsoft.com/fwlink/?linkid=830387
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"name": "Attach .NET Debugger",
7+
"type": "coreclr",
8+
"request": "attach"
9+
},
10+
]
11+
}

.vscode/tasks.json

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
// Tasks documentation: https://go.microsoft.com/fwlink/?LinkId=733558
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"label": "Generate Dockerfiles",
7+
"type": "shell",
8+
"command": "pwsh ./eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1",
9+
"group": "build",
10+
"problemMatcher": [
11+
{
12+
"owner": "generate-dockerfiles",
13+
"fileLocation": [
14+
"relative",
15+
"${workspaceFolder}"
16+
],
17+
"pattern": [
18+
{
19+
"regexp": "^(?: )*Template parsing error in file (.*):(.*)(?: )*$",
20+
"file": 1,
21+
"location": 2
22+
},
23+
{
24+
"regexp": "^(?: )*Message: (.*)$",
25+
"message": 1
26+
}
27+
]
28+
}
29+
]
30+
},
31+
{
32+
"label": "Generate Readmes",
33+
"type": "shell",
34+
"command": "pwsh ./eng/readme-templates/Get-GeneratedReadmes.ps1",
35+
"group": "build",
36+
"problemMatcher": [
37+
{
38+
"owner": "generate-readmes",
39+
"fileLocation": [
40+
"relative",
41+
"${workspaceFolder}"
42+
],
43+
"pattern": [
44+
{
45+
"regexp": "^(?: )*Template parsing error in file (.*):(.*)(?: )*$",
46+
"file": 1,
47+
"location": 2
48+
},
49+
{
50+
"regexp": "^(?: )*Message: (.*)$",
51+
"message": 1
52+
}
53+
]
54+
}
55+
]
56+
},
57+
{
58+
"label": "Test with debugger",
59+
"type": "process",
60+
"isBackground": true,
61+
"command": "dotnet",
62+
"args": [
63+
"test",
64+
"--filter",
65+
"\"Category=runtime-deps|Category=runtime|Category=aspnet|Category=sdk|Category=monitor|Category=aspire-dashboard\"",
66+
67+
// Filter by fully qualified test name:
68+
// "--filter",
69+
// "\"VerifyFxDependentAppScenario&(Category=runtime|Category=aspnet)\"",
70+
],
71+
"options": {
72+
"cwd": "${workspaceFolder}/tests/Microsoft.DotNet.Docker.Tests",
73+
"env":
74+
{
75+
"IMAGE_ARCH": "amd64",
76+
"SOURCE_BRANCH": "nightly",
77+
"SOURCE_REPO_ROOT": "${workspaceFolder}",
78+
"VSTEST_HOST_DEBUG": "1",
79+
"DOTNET_CLI_TELEMETRY_OPTOUT": "1",
80+
"DOTNET_SKIP_FIRST_TIME_EXPERIENCE": "1",
81+
"DOTNET_MULTILEVEL_LOOKUP": "0",
82+
83+
// Uncomment to specify optional environment variables:
84+
// "DOCKERFILE_PATHS": "*",
85+
// "PULL_IMAGES": "true",
86+
}
87+
},
88+
"group": "test",
89+
"presentation": {
90+
"echo": true,
91+
"reveal": "always",
92+
"focus": false,
93+
"panel": "shared"
94+
},
95+
"problemMatcher": []
96+
},
97+
]
98+
}

CONTRIBUTING.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ However, if you'd still like to implement it yourself, you can request the issue
3939

4040
When making PRs, all source code changes (e.g. Dockerfiles, tests, and infrastructure) should be made in the [nightly branch](https://github.com/dotnet/dotnet-docker/tree/nightly). Only changes to the samples and documentation will be accepted against the [main branch](https://github.com/dotnet/dotnet-docker/tree/main).
4141

42-
### Workflow Instructions
43-
44-
#### Building
42+
### Building
4543

4644
The [`build-and-test.ps1`](https://github.com/dotnet/dotnet-docker/blob/main/build-and-test.ps1) script will build and test the .NET Docker images. Given the matrix of supported .NET versions, distros, and architectures there are numerous Dockerfiles and building can take a while. To make this manageable, the script supports several options for filtering down what images get built and tested.
4745

@@ -75,15 +73,15 @@ The [`build-and-test.ps1`](https://github.com/dotnet/dotnet-docker/blob/main/bui
7573
> ./build-and-test.ps1 -Version 9.0 -OS nanoserver-1809 -Mode Test
7674
```
7775

78-
#### Editing Dockerfiles
76+
### Editing Dockerfiles
7977

8078
The [Dockerfiles](https://github.com/search?q=repo%3Adotnet%2Fdotnet-docker+path%3Asrc%2F**%2FDockerfile&type=code&ref=advsearch) contained in this repo are generated from a set of [Cottle](https://cottle.readthedocs.io/en/stable/page/01-overview.html) based [templates](https://github.com/dotnet/dotnet-docker/tree/main/eng/dockerfile-templates). A single template generates the set of Dockerfiles that are similar (e.g. all Windows sdk Dockerfiles for a particular .NET version). This ensures consistency across the various Dockerfiles and eases the burden of making changes to the Dockerfiles. Instead of editing the Dockerfiles directly, the templates should be updated and then the Dockerfiles should get regenerated by running the [generate Dockerfiles script](https://github.com/dotnet/dotnet-docker/blob/main/eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1).
8179

82-
#### Editing READMEs
80+
### Editing READMEs
8381

8482
The [READMEs](https://github.com/search?q=repo%3Adotnet%2Fdotnet-docker+path%3A**%2FREADME*+-path%3Aeng+-path%3Asamples&type=code&ref=advsearch&p=1) contained in this repo are used as the descriptions for the Docker repositories the images are published to. Just like the Dockerfiles, the READMEs are generated from a set of [Cottle](https://cottle.readthedocs.io/en/stable/page/01-overview.html) based [templates](https://github.com/dotnet/dotnet-docker/tree/main/eng/readme-templates). This ensures consistency across the various READMEs and eases the burden of making changes. Instead of editing the READMEs directly, the templates should be updated and then the READMEs should get regenerated by running the [generate READMEs script](https://github.com/dotnet/dotnet-docker/blob/main/eng/readme-templates/Get-GeneratedReadmes.ps1).
8583

86-
#### Tests
84+
### Tests
8785

8886
There are two basic types of [tests](https://github.com/dotnet/dotnet-docker/tree/main/tests) for each of the images produced from this repo.
8987

@@ -92,7 +90,32 @@ There are two basic types of [tests](https://github.com/dotnet/dotnet-docker/tre
9290

9391
When editing Dockerfiles, please ensure the appropriate test changes are also made.
9492

95-
#### Metadata Changes
93+
#### Debugging Tests Using VS Code
94+
95+
This repo comes with VS Code Task and Launch Profiles to help you debug tests.
96+
97+
To start, open [tasks.json](.vscode/tasks.json) and find the "Test with debugger" task.
98+
Check the `args` and `env` settings to filter down to the exact image you want to test.
99+
100+
To filter tests to a specific image, use the `DOCKERFILE_PATHS` environment variable.
101+
For example, to test only Alpine 3.20 ASP.NET images, you could set the `DOCKERFILE_PATHS` to `src/aspnet/9.0/alpine3.20/amd64`.
102+
To run specific individual tests, you can use [Xunit test filtering](https://learn.microsoft.com/dotnet/core/testing/selective-unit-tests?pivots=xunit) arguments to filter by fully qualified test name and test category.
103+
104+
To start debugging, open the VS Code command palette and type "Tasks: Run Task", then choose the "Test with debugger" task. The terminal will open and print a process ID:
105+
106+
```console
107+
Host debugging is enabled. Please attach debugger to testhost process to continue.
108+
Process Id: 19972, Name: testhost
109+
Waiting for debugger attach...
110+
```
111+
112+
From the "Run and Debug" sidebar panel, run the "Attach .NET Debugger" launch configuration (once it's selected, you can quickly run it again by pressing F5).
113+
VS Code will prompt you for a process ID to attach to.
114+
Type in the PID that was printed to the terminal earlier.
115+
Now, VS Code is attached to the .NET Debugger.
116+
You can press F5 (Continue) to start test execution.
117+
118+
### Metadata Changes
96119

97120
The [`manifest.json`](https://github.com/dotnet/dotnet-docker/blob/main/manifest.json) contains metadata used by the engineering infrastructure to build and publish the images. It includes information such as:
98121

@@ -105,7 +128,7 @@ The [`manifest.json`](https://github.com/dotnet/dotnet-docker/blob/main/manifest
105128

106129
When adding or removing Dockerfiles, it is important to update the `manifest.json` accordingly.
107130

108-
#### Updating Product Versions
131+
### Updating Product Versions
109132

110133
Updating the product versions (e.g. .NET runtime, ASP.NET runtime, PowerShell, etc.) contained within the images is typically performed by automation. All of the product version information is stored in the [`manifest.versions.json`](https://github.com/dotnet/dotnet-docker/blob/main/manifest.versions.json) file. The Dockerfile templates reference the product versions numbers and checksums from this file. Updating a product version involves updating the `manifest.versions.json` and regenerating the Dockerfiles. If there are cases where you need to update a product version, you can use the [update-dependencies](https://github.com/dotnet/dotnet-docker/tree/main/eng/update-dependencies) tool. The tool will do the following:
111134

0 commit comments

Comments
 (0)