0
votes

I am pretty new to Heroku.

Issue Description

After successfully pushing a docker image to Heroku Container Registry using JIB I am struggling to release it.

What I did:

Pushed docker image using JIB:

[INFO] Built and pushed image as hamzablm/timesheet
[INFO] Executing tasks:
[INFO] [===========================   ] 88.9% complete
[INFO] > launching layer pushers
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  51.106 s
[INFO] Finished at: 2020-04-20T11:16:20Z
[INFO] ------------------------------------------------------------------------

By now the image should be in the registry. But when I want to release it: heroku container:release hamzablm/timesheet It fails:

 ›   Error: Missing required flag:
 ›     -a, --app APP  app to run command against
 ›   See more help with --help

I'm probably missing something simple here, but any help would be appreciated.

2
This isn't my case because the image is already in the registryHamza Belmellouki
Its the same error you need to specify your app namesquareborg
It's weird, because from the Heroku CLI commands, if you check your section (devcenter.heroku.com/articles/…) it says that -a is a required option.. then, in the example is not specified. What if you try to manually specify the flag?AndD
specifying -a option doesn't work either: ▸ Couldn't find that app.Hamza Belmellouki

2 Answers

2
votes

you are using the image name with the heroku container:release command, but you are supposed to use the name of the Heroku application.
This is normally what you need

docker push registry.heroku.com/appname/web
heroku container:release web -a appname

The application can be created via the Dashboard or the CLI

1
votes

So I encountered the same problem. However, I was working with a docker image that needed to be tagged and pushed to the heroku registry through a pipeline in Travis CI. After this I saw it was not released yet. When trying to release the container it would fail and give the same error as you encountered. In the steps below I will explain my fix. Please note the $VARIABLE contain variables passed along in Travis CI.

Step 1

I logged in to the Heroku with my Docker using the Heroku API key.

docker login --username _ --password=$HEROKU_API_KEY registry.heroku.com

Step 2

I tagged my Docker image to the registry of Heroku. Please note the following, I used the $TRAVIS_BUILD_NUMBER as my process type. This is a variable instantiated by Travis CI itself and does not have to be declared. In the examples shown by Heroku they use the word "web" as example but you can specify it as you please.

docker tag $DOCKER_USER/$DOCKER_IMAGE:latest registry.heroku.com/$HEROKU_APP_NAME/$TRAVIS_BUILD_NUMBER

Step 3

I pushed the image to the Heroku registry.

docker push registry.heroku.com/$HEROKU_APP_NAME/$TRAVIS_BUILD_NUMBER

Step 4

I released the container to Heroku by specifying the process type ($TRAVIS_BUILD_NUMBER) and the Heroku app name ($HEROKU_APP_NAME).

heroku container:release $TRAVIS_BUILD_NUMBER --app $HEROKU_APP_NAME

I hope you already fixed it but this might give a better insight into why your command fails. It is missing a process type and the --app flag. In the example below I assumed hamzablm/timesheet was your $HEROKU_APP_NAME variable:

 heroku container:release $MISSING_PROCESS_TYPE --app hamzablm/timesheet

I hope this gives a better understanding.