0
I don’t have much experience with Docker and programming, but when trying to run my project. net core with Docker it tries to compile, but after a while it returns the error below:
Erro CTC1014 O comando Docker falhou com o código de saída 1.
#2 [internal] load .dockerignore
#2 sha256:37a51b939b2f3d30b102f0c700e8a6ed297e3ef98c2ea7aa37901d50a244f5aa
#2 transferring context:
#2 transferring context: 2B done
#2 ...
#1 [internal] load build definition from Dockerfile
#1 sha256:b40ad48097b1b67b480985b3bace96e0b65d36111bc44586227e4315285e0eeb
#1 transferring dockerfile: 32B done
#1 DONE 0.4s
#2 [internal] load .dockerignore
#2 sha256:37a51b939b2f3d30b102f0c700e8a6ed297e3ef98c2ea7aa37901d50a244f5aa
#2 DONE 0.5s
#3 [internal] load metadata for mcr.microsoft.com/dotnet/core/sdk:3.1
#3 sha256:b2e5e1691f8e48edebecccdb649a2de20dda9e0f52cc817f2e6ef4b3c09e2f63
#3 DONE 0.0s
#4 [build-env 1/6] FROM mcr.microsoft.com/dotnet/core/sdk:3.1
#4 sha256:dfc467baa129d8678264d001ebf90c0ab19a33088a5e8cf802c3b6a481fd3176
#4 DONE 0.0s
#6 [internal] load build context
#6 sha256:950bada1881341f947485c3ad24b5b47088d6553a8604c6b2647c10e01a7aeae
#6 transferring context: 893.25kB 1.4s done
#6 DONE 1.7s
#5 [build-env 2/6] WORKDIR /app
#5 sha256:bc5f8afe5ff6bb87335ae7d80b1dd12a77ad6394cd24d4608590bd3fb7068ab5
#5 CACHED
#7 [build-env 3/6] COPY *.csproj ./
#7 sha256:dc6758d23f445df747d1bfc9debcd3c51fcb404ebefe1e4204b3754573de6717
#7 CACHED
#8 [build-env 4/6] RUN dotnet restore
#8 sha256:e70042c3bb36240e9e9c94ceeff0ce892b2742e6b69189eab045fdf2698f2225
#8 1.288 MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
#8 ERROR: executor failed running [/bin/sh -c dotnet restore]: exit code: 1
------
> [build-env 4/6] RUN dotnet restore:
------
executor failed running [/bin/sh -c dotnet restore]: exit code: 1 Integracao_ECommerce C:\Gabrieltmp\Bitbucket\integracao-gateway\Dockerfile 1
My Dockerfile file looks like this:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
ENV TZ=America/Sao_Paulo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /app
COPY --from=build-env /app/out .
EXPOSE 80 5000
ENTRYPOINT ["dotnet", "Integracao_ECommerce.dll"]
Can you help me solve this problem?
along those lines
COPY *.csproj ./
is copying only the files.csproj
, it would be interesting to copy tbm to Solution tb withCOPY *.sln ./
following that line and testing.– Ricardo Pontual