Honda.Domain/ Honda.Domain.csproj Honda.API/ Honda.API.csproj Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 WORKDIR /app # copy csproj and restore as distinct layers COPY ./Honda.Domain/Honda.Domain.csproj ./Honda.Domain/ COPY ./Honda.API/Honda.API.csproj Honda.API/ RUN dotnet restore Honda.API/Honda.API.csproj # copy everything else and build app COPY . ./ WORKDIR /app/Honda.API/ RUN dotnet publish -c Release -o publish/ FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 WORKDIR /app COPY --from=build /app/Honda.API/publish . ENV ASPNETCORE_URLS=https://+:5001;http://+:5000 ENTRYPOINT ["dotnet", "Honda.API.dll"]
Trying to build using command:
docker build -t honda-api:build .
Step 17/19 : COPY –from=build /app/Honda.API/publish .
invalid from flag value build: pull access denied for build,
repository does not exist or may require ‘docker login’: denied:
requested access to the resource is denied
You are using the
--from flag which is supposed to copy something from a previous stage build.
Optionally COPY accepts a flag --from=<name> that can be used to set the source location to a previous build stage (created with FROM .. AS <name>) that will be used instead of a build context sent by the user. In case a build stage with a specified name can’t be found an image with the same name is attempted to be used instead.
Read here first about multi stage builds: https://docs.docker.com/develop/develop-images/multistage-build/
If this is what you are trying to achieve you should modify your first line to be like:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build
Correct answer by J-Mous on December 14, 2020
3 Asked on December 23, 2020 by philipp-claen
1 Asked on December 23, 2020 by helderam
0 Asked on December 23, 2020
1 Asked on December 23, 2020 by ordineu
1 Asked on December 23, 2020 by suragch
5 Asked on December 22, 2020 by muhtadi
1 Asked on December 22, 2020 by doe
1 Asked on December 22, 2020 by dashman
2 Asked on December 22, 2020 by daniel-von-mirbach
0 Asked on December 22, 2020 by ji-in-kim
0 Asked on December 22, 2020 by entity
1 Asked on December 22, 2020 by sudheer-ranjan
1 Asked on December 22, 2020 by sean-thorburn
0 Asked on December 21, 2020 by asfdasfdsfdfsd
1 Asked on December 21, 2020 by omnifarious
3 Asked on December 21, 2020 by varad-paralikar
Get help from others!