3
votes

I have a simple .NET core MVC application(default one you get when you select the MVC template), but when I try and push to heroku I get a "received unexpected HTTP status: 500 Internal Server Error ! Error: docker push exited with Error: 1" error

My dockerfile is:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base

WORKDIR /app

COPY . .

CMD ASPNETCORE_URLS=http://*:$PORT dotnet TestCore.dll


I have followed the documentation, create a release, build, tag then push.
My steps:
Create a release "dotnet publish -c Release", then copy my dockerfile to this location.

Create a docker build "docker build -t matth-testapp ./bin/Release/netcoreapp2.1/publish"

Tag my image "docker tag matth-testapp registry.heroku.com/matth-testapp/web"

Then push "heroku container:push web -a matth-testapp"

I am logged-in to heroku via the heroku cli, same for heroku container:login. I have nothing in my heroku app log, so have no idea whats going on. Any pointers of where to look would be appreciated.

2

2 Answers

3
votes

Solved:

I forgot Heroku uses Linux containers! I was trying to build and deploy using windows containers still.

Building after switching has resolved this issue :)

1
votes

I also faced the same error, in my case the registry was full. So I added archival policy to the images and made some space, it solved my problem.