dockerherokudeployment

Heroku Error: This command is for Docker apps only. Run git push heroku main to deploy


My existing deployment method of Heroku app is GitHub, Now I am planning to deploy the application using Heroku container (Docker based). I am facing "Error: This command is for Docker apps only. Run git push heroku main to deploy" issue, while I am heroku container:release web --app {MyHerokuAppName}}

CMD:Root Directory> heroku login

CMD:Root Directory>heroku container:login

CMD:Root Directory>heroku stack:set container --app {{MyHerokuAppName}}

CMD:Root Directory> docker tag {{DockerImageName}}:latest registry.heroku.com/{{MyHerokuAppName}}/web

CMD:Root Directory>docker push registry.heroku.com/{{MyHerokuAppName}}/web

CMD:Root Directory>heroku container:release web --app {{MyHerokuAppName}}

I am facing issue in the last step.


Solution

  • I have destroyed the {{MyHerokuAppName}} and recreate the same app and then we could set the stack and as container and push the code and release also done from Powershell of my local system.

    the reason will be if we are using other than "Container" deployment for an app then it will not clear/reset the deployment stack/type of dyno.

    While doing the app destroy, we need taking care on the resources which are attached.