|
1 | 1 | # Developer Guide |
2 | 2 |
|
3 | | -This document contains getting-started resources for those that want to develop this tool. |
4 | | - |
5 | | -## Using the prerelease package from this repository |
6 | | - |
7 | | -The easiest way to use the prerelease package is to follow [these GitHub docs](https://docs.github.com/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry). |
8 | | - |
9 | | -You'll want to use a nuget.config file to |
10 | | - |
11 | | -* define a source for this repository |
12 | | -* define credentials (username and Personal Access Token) to use when accessing this source |
13 | | - |
14 | | -Then, you can use `dotnet add package Microsoft.NET.Build.Containers -prerelease` to get the latest version. |
15 | | - |
16 | | -You can also always clone this repository, run `dotnet build`, and use the newly-generated nupkg. |
17 | | - |
18 | | -To use the package built from the CI pipeline: |
19 | | - |
20 | | -* add the github package source to your nuget.config of choice |
21 | | - * `dotnet nuget add source https://nuget.pkg.github.com/dotnet/index.json --name dotnet-org-github --username <your github username> --password <your github PAT with read:packages permission at minimum> --configfile <path to desired nuget config file>` |
22 | | -* add the package to a project |
23 | | - * `dotnet add package Microsoft.NET.Build.Containers --prerelease` (or `--version <version number>`) |
24 | | - |
25 | | -To use your locally built packages: |
26 | | - |
27 | | -* Add a local nuget source: |
28 | | - * `dotnet nuget add source C:\temp\packages -n local` |
29 | | -* Build the repo and note where the .nupkg is outputted: |
30 | | - * `dotnet build -c Release` |
31 | | - * ... |
32 | | - * `Successfully created package 'C:\git\sdk-container-builds\Microsoft.NET.Build.Containers\bin\Release\Microsoft.NET.Build.Containers.0.2.0-alpha.14.gda83f2fee0.nupkg'.` |
33 | | -* Push the generated package to the local source: |
34 | | - * `dotnet nuget push C:\git\sdk-container-builds\Microsoft.NET.Build.Containers\bin\Release\Microsoft.NET.Build.Containers.0.2.0-alpha.14.gda83f2fee0.nupkg -s local` |
35 | | -* In a test project, add the local package: |
36 | | - * `dotnet add package Microsoft.NET.Build.Containers --version 0.2.0-alpha.14.gda83f2fee0` |
37 | | -* Publish the test project with `-p:PublishProfile=DefaultContainer` to create a container for your application: |
38 | | - * `dotnet publish -c Release --os linux --arch x64 -p:PublishProfile=DefaultContainer` |
39 | | -* Run your test app to ensure it works |
40 | | - * `docker run -it --rm -p 5010:80 myapp:1.0.0` |
41 | | - |
42 | | -> **Note** |
43 | | -> Rebuilding and restoring local NuGet packages may cause versioning conflicts due to NuGet caching earlier iterations with the same version number. Be sure to delete the `microsoft.net.build.containers` folder in the NuGet cache in between building and restoring new changes to this repo. For example: |
44 | | - * `rmdir -Force -Recurse ~\.nuget\packages\microsoft.net.build.containers` |
45 | | - * `rm -rf ~/.nuget/packages/microsoft.net.build.containers` |
46 | | - |
47 | | -## Using the package when implicit SDK support is enabled |
48 | | - |
49 | | -If you are on SDK 7.0.200 or greater, are a Web SDK project, and have `EnableSdkContainerSupport` set to `true` in your project file, you will need to use another mechanism to reference the generated package. You can do one of the following actions: |
50 | | - |
51 | | -* Set `EnableSdkContainerSupport` to `false` in your project file and use a normal PackageReference as described above, |
52 | | -* Keep `EnableSdkContainerSupport` set to `true` and set the `SdkContainerSupportPackageVersion` property to the version you built above, |
| 3 | +To be updated |
53 | 4 |
|
54 | 5 | ## References |
55 | 6 |
|
|
0 commit comments