Research progress - Sarafian/MiniNugetServer GitHub Wiki
This repository is a proof of concept on how to dockerize a simple ASP.NET application. Since I often work with PowerShell modules and I need an internal repository for testing, I chose to dockerize a Mini NuGet Server using the nuget package NuGet.Server.
Within this repository each branch represents a certain stage in the proof of concept also matching a specific issue. Compare the branch from each step with the previous one to see the code changes.
- Source code
- Powershell automation to produce a container image asarafian/mininugetserver.
- Scripts to help run the container image.
- Branch BuildAutomationReady.
- The repository is enhanced with a couple of scripts to debug and run the container image.
- The microsoft/aspnet image depends on the microsoft/iis that specifies an
ENTRYPOINT
referencing theServiceMonitor.exe
. TheENTRYPOINT
is inherited to the microsoft/aspnet and then to asarafian/mininugetserver. Once theENTRYPOINT
is defined in a docker container file it is impossible to run something in between such as a configuration script. For this reason, I changed the referenced image to microsoft/windowsservercore, copied the code from the build files of microsoft/iis and microsoft/aspnet and added aCMD
statement to a script that- Stops the IIS websites.
- Modifies the config files.
- Starts the IIS websites.
- Executes the ServiceUser.exe.
- Branch DynamicApiKey.
- Code changes
- Please provide feedback to the solution.
- Verified that the container could work with mounted volumes and updated the examples.
- Branch MountVolume.
- Code changes
- Build process is moved into the container.
- Target framework changed from .net462 to .net46.
- Docker file is structured in manner that makes easy to comment lines from the
RUN
statements. - Docker file and scripts are positioned with the same relative paths as when they executed from within the container.
- The sequence is summarized like this
- Add the repository inside the container and copy the necessary scripts.
- Add the ServiceMonitor.exe
- Install necessary windows features.
- Invoke the build and publish. This step includes installing the necessary Windows-SDK and MSBuiltTools2015
- Configure IIS
- Branch buildincontainer.
- Code changes
- Load balance multiple instances. [Done]
- Branch compose.
- Code changes
- Test the image with powershell. [Done]
- Pester scripts added.
- Updated information on the README.
- Branch Pester.
- Code changes
- Automate the publish process. In progress
- Publish the image to docker hub. In progress