skip to Main Content

I’m getting a very opaque error message – CTC1014 Docker command failed with exit code 0.

This Dockerfile worked well previously, but I think there is a problem with it in Visual Studio 2022.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine AS base
WORKDIR /app
EXPOSE 80

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

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

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

Here is some output contained in the error message.

Error   CTC1014 Docker command failed with exit code 0.
#1 [internal] load build definition from Dockerfile
#1 sha256:ba397cfd6a85fea7615e57b5f632e17dfe4ac20a6c2b07dfdcd8c7a587e883e6
#1 transferring dockerfile: 32B 0.0s done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 sha256:bfedc4c930f4484872cee371d877847209702c992fc338f315c6a2ebe3dc8641
#2 transferring context: 35B 0.0s done
#2 DONE 0.0s

#3 [internal] load metadata for mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
#3 sha256:9337467cb8fe7867559fc863b311aabee0d106a98140d42d52ac6117f7521c70
#3 DONE 0.0s

#4 [base 1/2] FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
#4 sha256:092644c54b62ff663a37e497fd57dae090e3e2dfcf4d8a2e244da3f243a8e7ba
#4 DONE 0.0s

#5 [base 2/2] WORKDIR /app
#5 sha256:dd536a017cb8f843354fc922eca5f2a24794bce1f7aefdae696c44de0399c8eb
#5 CACHED

#6 exporting to image
#6 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#6 exporting layers done
#6 writing image sha256:bdf53eed611b6b0e2edb0c20902378cb6cb2683ac8401acf88f51951a248ca48 
done
#6 naming to docker.io/library/domain:dev done
#6 DONE 0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how 
to fix them 

It seems only two of the Docker commands are completing. Is there something wrong with this Dockerfile? Why is this project not running in Visual Studio 2022?

2

Answers


  1. Chosen as BEST ANSWER

    I think it was that the Container Tools Nuget package needed updating for VS 2022, but in the end there were more issues and I ended up upgrading to .NET 6


  2. Updating the Container Tools Nuget Package did the trick for me as well on VS 2022. Thanks

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search