Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker pushing to Heroku "Unexpected HTTP status: 500 internal server error"

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.

like image 813
Matt Hobbs Avatar asked Sep 11 '25 16:09

Matt Hobbs


2 Answers

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 :)

like image 193
Matt Hobbs Avatar answered Sep 13 '25 06:09

Matt Hobbs


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.

like image 23
Neha Avatar answered Sep 13 '25 05:09

Neha