Docker Community Forums

Share and learn in the Docker community.

Section of windows Dockerfile taking a long time

I have a docker file that essentially looks like this.

FROM AS base

FROM AS build

USER Administrator

ADD C:\build\
RUN mkdir “C:\Program Files\node” &&
tar.exe -xf C:\build\ -C “C:\Program Files\node” --strip-components=1
RUN setx /M PATH “C:\Program Files\node;%PATH%”

RUN RMDIR /s /q c:\build

COPY . .

COPY .nuget/nuget.config .
RUN dotnet restore “something.csproj” --configfile nuget.config

WORKDIR “/src/folder with something.csproj”
RUN dotnet build “something.csproj” -c Release -o /app

FROM build AS publish
RUN dotnet publish “something.csproj” -c Release -o /app

FROM base AS final
COPY --from=publish /app .

copy buildnumber.html /app/wwwroot
ENTRYPOINT [“dotnet”, “something.dll”]

the command COPY --from=publish /app .

takes a long time 10 min plus.

the publish folder is only 88 File(s) 6,770,947 bytes

Any ideas why it takes so long?

This copy command is taking up to 25 minutes. It seems to be excessively long. Is this normal when copying from one docker image layer to another… since this is from publish to final.

thanks in advance.