The FROM instruction must begin a Dockerfile and selects the base image to modify. Because images are immutable, each build starts from a base and saves changes into a new image. section 13.3.1
A Dockerfile may contain multiple FROM instructions for separate build stages, allowing published application output to move from an SDK image into a smaller runtime image. section 13.3.1
Selecting a .NET base image
FROM mcr.microsoft.com/dotnet/sdk:6.0 selects the official .NET 6 SDK container. Subsequent COPY, WORKDIR, EXPOSE, and ENTRYPOINT instructions modify that starting image. section 13.3.1
Listing 13.2 Dockerfile for AsciiArtSvc
# Use the official .NET 6 container FROM mcr.microsoft.com/dotnet/sdk:6.0 # Copy files from the current folder on your machine to # the /src folder in the container COPY . /src # Set working directory in the container WORKDIR /src # Expose HTTP port from "docker" launch profile EXPOSE 5101 # Run the application when the container is started ENTRYPOINT ["dotnet", "run", "--launch-profile", "docker"]
Inspect the complete Dockerfile to see how FROM establishes the base for copying source files and configuring application startup. section 13.3.1


