missing microsoft docker images

  .net-core, asp.net-core, docker, dockerfile

I am fairly new to docker and running some tutorials at the moment.

I have craeted a docker file through VSCode Extension and I have the following :-

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["CatalogDotNet5.csproj", "./"]
RUN dotnet restore "CatalogDotNet5.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "CatalogDotNet5.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "CatalogDotNet5.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CatalogDotNet5.dll"]

Now I run docker build -t catalogdotnet5:v1 . in the console, and after everything finishes, I check the docker images and I only have :-

catalogdotnet5   v1        7ecc6bc42bba   27 seconds ago   217MB

Shouldn’t I also have mcr.microsoft.com/dotnet/aspnet:5.0 and mcr.microsoft.com/dotnet/sdk:5.0 as docker images?

Thanks for your help and time

Source: Docker Questions

LEAVE A COMMENT