Skip to content

Commit bdbee39

Browse files
committed
Update CONTRIBUTING.md with workflow instructions (dotnet#2118)
1 parent 4b0f747 commit bdbee39

File tree

2 files changed

+85
-4
lines changed

2 files changed

+85
-4
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing
2+
3+
See [dotnet/runtime Contributing](https://github.com/dotnet/runtime/blob/master/CONTRIBUTING.md) for information about coding styles, source structure, making pull requests, and more.
4+
5+
## Branches
6+
7+
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 [master branch](https://github.com/dotnet/dotnet-docker/tree/master).
8+
9+
## Workflow Instructions
10+
11+
### Building
12+
13+
The [`build-and-test.ps1`](https://github.com/dotnet/dotnet-docker/blob/master/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.
14+
15+
- Build and test all of the .NET 5.0 images for the Docker platform your machine is targeting (e.g. linux/x64, linux/arm, linux/arm64, windows/x64).
16+
17+
``` console
18+
> ./build-and-test.ps1 -Version 5.0
19+
```
20+
21+
- Build the 3.1 Nano Server 1809 images
22+
23+
``` console
24+
> ./build-and-test.ps1 -Version 3.1 -OS nanoserver-1809 -Mode Build
25+
```
26+
27+
- Build and test the samples
28+
29+
``` console
30+
> ./build-and-test.ps1 -Path *samples* -TestCategories sample
31+
```
32+
33+
- Test the 5.0 Alpine 3.12 images for the current architecture (e.g. x64, arm, arm64).
34+
35+
``` console
36+
> ./build-and-test.ps1 -Version 5.0 -OS alpine3.12 -Mode Test
37+
```
38+
39+
### Editing Dockerfiles
40+
41+
The [Dockerfiles](https://github.com/search?q=repo%3Adotnet%2Fdotnet-docker+filename%3ADockerfile&type=Code&ref=advsearch&l=&l=) contained in this repo are generated from a set of [templates](https://github.com/dotnet/dotnet-docker/tree/master/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/master/eng/dockerfile-templates/Get-GeneratedDockerfiles.ps1)
42+
43+
### Tests
44+
45+
There are two basic types of [tests](https://github.com/dotnet/dotnet-docker/tree/master/tests) for each of the images produced from this repo.
46+
47+
1. Unit tests that validate the static state of images. This includes things like verifing which environment variables are defined.
48+
1. Scenario tests that validate basic usage scenarios. For example the SDK image is used to create, build and run a new console app.
49+
50+
When editing Dockerfiles, please ensure the appropriate test changes are also made.
51+
52+
### Metadata Changes
53+
54+
The [`manifest.json`](https://github.com/dotnet/dotnet-docker/blob/master/manifest.json) contains metadata used by the engineering infrastructure to build and publish the images. It includes information such as:
55+
56+
- Dockerfiles to build
57+
- Image Tags
58+
- Manifest/shared tags to create and which images they reference
59+
- Docker repositories to publish the images to
60+
- Dockerfile templates used to generate the Dockerfiles
61+
- etc.
62+
63+
When adding or removing Dockerfiles, it is important to update the `manifest.json` accordingly.
64+
65+
### Updating Product Versions
66+
67+
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/master/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/master/eng/update-dependencies) tool. The tool will do the following:
68+
69+
1. Update the product versions and checksums stored in `manifest.versions.json`
70+
1. Regenerate the Dockerfiles
71+
1. Update the tags listing in the readmes
72+
73+
The following examples illustrate how to run `update-dependencies`:
74+
75+
- Update the 3.1 product versions
76+
77+
``` console
78+
> dotnet run --project .\eng\update-dependencies\ -- 3.1 --product-version runtime=3.1.6 --product-version aspnet=3.1.6 --product-version sdk=3.1.302
79+
```
80+
81+
- Update the PowerShell version used in the 5.0 images
82+
83+
``` console
84+
> dotnet run --project .\eng\update-dependencies\ -- 5.0 --product-version powershell=7.1.0-preview.4 --compute-shas
85+
```

0 commit comments

Comments
 (0)