If I have a docker file that has multiple stages (such as base and build), is there a way to change the docker command that visual studio uses when debugging the container - it seems to use the first build in the docker file, without invoking the subsequent stages.
Here is my docker file:
FROM microsoft/aspnetcore:2.0.3 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/aspnetcore-build:2.0.3 AS build
WORKDIR /src
COPY *.sln ./
COPY Web/Web.csproj Web/
RUN dotnet restore
COPY . .
WORKDIR /src/Web
RUN dotnet build -c Release -o /app
FROM build AS publish
#RUN npm install
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
# Set the entry point of the application.
ENTRYPOINT ["dotnet", "Web.dll"]
When I hit f5, it will create the container with the base image, and subsequently result in error because the project needs the node install of the aspnetcore-build image; I can resolve this by changing the base image to be the aspnetcore-build.
However, is there a way to tell the project in visual studio that it is a multi-stage build and needs to use build?
I am very new to docker so perhaps I am missing something obvious.