Need help with Docker image for .Net application with dependencies - Windows


I am having a dotnet core application which is running some python libraries and blazemeter tool to run load testing for website URLs. For that I have a dotnet API application which when executed runs a blazemeter tool using python libraries to run the load test and produce results. The parameters will be passed using dotnet API and it needs to be executed.

Here I am trying to dockerize this application as a docker image and host in container for easy CI/CD process. But there seems to be an issue with the image where I need to install all the dependencies and then the application DLLs to be created as an image. In the image, I am not able to install VC++ redistributable which is a mandatory for rapidfuzz python library. When I try to install VC++, I need to install the exe downloading from Microsoft library and execute using Entrypoint["cmd’}. For installing the dotnet libraries, I am using Entrypoint[“dotnet”, “Project.dll”]. I will not be able to use two Entrypoints in the same dockerfile. Not sure how to proceed. Please find attached my dockerfile entry which i tried using:

FROM Microsoft Artifact Registry

COPY VC_redist.x64.exe .

RUN VC_redist.x64.exe /install /passive /norestart /log out.txt

COPY [“/”, “.”]
COPY [“/”, “.”]


FROM Microsoft sdk:6.0 AS build-env

Copy csproj and restore as distinct layers

COPY *.csproj ./
RUN dotnet restore

Copy everything else and build

COPY . ./
RUN dotnet publish -c Release -o out

Build runtime image

FROM aspnet library

COPY --from=build-env /app/out .
ENTRYPOINT [“dotnet”, “TestDesignStudioAPI.dll”]

In the above Dockerfile, I am trying the below steps:

  1. Install VC++ redistributable
  2. Copy Python files to image and extract them inside the “app” work directory.
  3. Copy Java files to image and extract them inside the “app” work directory.
    4, Later I will need to set environment variables for both Python and Java which I am currently doing directly in command prompt inside the app directory of the image.
  4. Build, publish my dotnet dll as an image.

If I do the steps 4 separately as an image, it is working fine installing the VC++ redistributable. Also If I do the step 5 separately, it is creating an image, and i when I host it in container and assign a port, the application is running fine.

Not sure how to do everything as a single image and make my application work fine. Can anyone please suggest a feasible solution on how to achieve this?

Thanks in Advance.

(post deleted by author)