I used following docker script to build and run my ASP.NET Web API project on .net 4.6.1 framework.
FROM microsoft/dotnet-framework:4.7.2-sdk AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.sln .
COPY TestWebAPI/*.csproj ./TestWebAPI/
COPY TestWebAPI/*.config ./TestWebAPI/
RUN nuget restore
# copy everything else and build app
COPY TestWebAPI/. ./TestWebAPI/
WORKDIR /app/TestWebAPI
RUN msbuild /p:Configuration=Release
FROM microsoft/aspnet:4.7.2 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/TestWebAPI/. ./
In the first step I am setting app folder as my working directory. But after creating container, I do not see any folder name app on my C:
--To create Image
docker image build --tag testwebapi --file .\Dockerfile .
--To run container
docker container run --detach --publish 80 testwebapi
--To see containers content
docker exec -i -t a1da40af6b3c powershell
Where does docker keep the source code?
