I have few microservices (each docker file at project level) and they all consume "commonDLL" project. The commondll project is referenced in each micro services solution file. Running into issues with generating docker images. It says unable to find the external project while copying. How should the docker file be defined? Do I need a Docker Compose file? Some say to create a image just for commondll project, how would i reference in each microservices docker file?
I have limited knowledge of "Docker". Eventually, it will be deployed into AKS. Any help is appreciated.
Project Structure (Image)
Docker file
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["CompanyName.AccountService/CompanyName.AccountService.csproj", "CompanyName.AccountService/"]
COPY ["../CompanyName.CoreProject/CoreProject/CoreProject.csproj", "../CompanyName.CoreProject/CoreProject/"] (********FAILED******)
RUN dotnet restore "CompanyName.AccountService/CompanyName.AccountService.csproj"
COPY . .
RUN dotnet publish "CompanyName.AccountService.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /appc
COPY --from=build /app/publish .
EXPOSE 500
EXPOSE 5000
ENV ASPNETCORE_URLS http://*:500;https://*:5000;
ENTRYPOINT ["dotnet", "CompanyName.AccountService.dll"]