Hello. I am new to Docker.
I have a standard Dockerfile that VS made for a .net Core MVC project.
Here it is:
#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
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR / src
COPY ["EG_TESTIMAGE / EG_TESTIMAGE.csproj", "EG_TESTIMAGE /"]
RUN dotnet restore "EG_TESTIMAGE / EG_TESTIMAGE.csproj"
COPY. ...
WORKDIR "/ src / EG_TESTIMAGE"
RUN dotnet build "EG_TESTIMAGE.csproj" -c Release -o / app / build
FROM build AS publish
RUN dotnet publish "EG_TESTIMAGE.csproj" -c Release -o / app / publish
FROM base AS final
WORKDIR / app
COPY --from = publish / app / publish.
ENTRYPOINT ["dotnet", "EG_TESTIMAGE.dll"]
I am using nlog. There are two configuration files nlog.config and nlog.config.development.
When running docker build command, I need to copy nlog.config to nlog.config.development. (For correct operation of logs on the server with ASPNETCORE_ENVIRONMENT = development)
I am trying to make the command:
COPY nlog.config nlog.config.development - fails.
How to do it correctly?