DockerFile:
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base WORKDIR /app EXPOSE 80 EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build WORKDIR /src
##COPY ["ApiDocker/ApiDocker.csproj", "ApiDocker/"] COPY . ./
##RUN dotnet restore "ApiDocker.csproj"
##COPY . .
##WORKDIR "/src/ApiDocker"
##RUN dotnet build "ApiDocker.csproj" -c Release -o /app/build
FROM build AS publish RUN dotnet publish "ApiDocker.csproj" -c Release -o /app/publish
FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "ApiDocker.dll"]
comando que uso docker build -f Dockerfile -t teste .
Step 1/13 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
---> fe3a4716eba4
Step 2/13 : WORKDIR /app
---> Using cache
---> a48087819278
Step 3/13 : EXPOSE 80
---> Using cache
---> 0557bb867345
Step 4/13 : EXPOSE 443
---> Using cache
---> 25859f037cbc
Step 5/13 : FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
---> a2b4ee9c3a72
Step 6/13 : WORKDIR /src
---> Using cache
---> 7d5595de82c4
Step 7/13 : COPY . ./
---> Using cache
---> 84ab003e9c38
Step 8/13 : FROM build AS publish
---> 84ab003e9c38
Step 9/13 : RUN dotnet publish "ApiDocker.csproj" -c Release -o /app/publish
---> Using cache
---> f00ac1e6bab6
Step 10/13 : FROM base AS final
---> 25859f037cbc
Step 11/13 : WORKDIR /app
---> Using cache
---> 632b6acfd9ac
Step 12/13 : COPY --from=publish /app/publish .
---> Using cache
---> fe157ca42411
Step 13/13 : ENTRYPOINT ["dotnet", "ApiDocker.dll"]
---> Using cache
---> 9140b9a4fadf
Successfully built 9140b9a4fadf
Successfully tagged teste:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
e aparece esse ero de permissão