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.

  1. Automate the build a default container image. [Done]
  • Source code
  • Powershell automation to produce a container image asarafian/mininugetserver.
  • Scripts to help run the container image.
  • Branch BuildAutomationReady.
  1. Run the container with dynamic apikey value. [Done]
  • 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 the ServiceMonitor.exe. The ENTRYPOINT is inherited to the microsoft/aspnet and then to asarafian/mininugetserver. Once the ENTRYPOINT 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 a CMD statement to a script that
    1. Stops the IIS websites.
    2. Modifies the config files.
    3. Starts the IIS websites.
    4. Executes the ServiceUser.exe.
  • Branch DynamicApiKey.
  • Code changes
  • Please provide feedback to the solution.
  1. Use a volume based directory for the Package folder. [Done]
  • Verified that the container could work with mounted volumes and updated the examples.
  • Branch MountVolume.
  • Code changes
  1. Move the build/publish of the site in the docker build file. [Done]
  • 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
    1. Add the repository inside the container and copy the necessary scripts.
    2. Add the ServiceMonitor.exe
    3. Install necessary windows features.
    4. Invoke the build and publish. This step includes installing the necessary Windows-SDK and MSBuiltTools2015
    5. Configure IIS
  • Branch buildincontainer.
  • Code changes
  1. Load balance multiple instances. [Done]
  1. Test the image with powershell. [Done]
  1. Automate the publish process. In progress
  2. Publish the image to docker hub. In progress