Can't release pushed docker image to heroku - docker

I am having the EXACT same issue as mentioned here: Can't release pushed docker image in heroku but no answers have seemed to worked.
Goal - I am trying to push a simple image or build from my docker on my laptop to heroku.
I already logged into heroku:
heroku login
I tried using the commands from here to push an existing image: https://devcenter.heroku.com/articles/container-registry-and-runtime#pushing-an-existing-image
>docker tag supportalloy/alloyautomate:latest registry.heroku.com/alloyautomate/app
>docker push registry.heroku.com/alloyautomate/app
Using default tag: latest
The push refers to repository [registry.heroku.com/alloyautomate/app]
e1abb02d73c6: Preparing
f0f8f865ab9e: Preparing
9c3ce5529e99: Preparing
bc918295c02b: Waiting
b1ac1eba9be8: Preparing
2638da3625d5: Pushed
7cc0623bd7a8: Pushed
f1859b30ca6b: Pushed
6a35d52a66fd: Pushed
fbd7d5451c69: Pushed
latest: digest: sha256:3e0ab858e3343XXXXXXXXXXX90c33f9ad5bfdc6a160bcaa7c2d97 size: 6622
So it seemed like as if the image was pushed to heroku but I don't see it anywhere in the dashboard. So I googled some more and apparently I am suppose to release the image after pushing but so far nothing has worked for releasing the image.
I tried:
heroku container:release web --app=alloyautomate
! Expected response to be successful, got 404
but got a 404 error
At this point I gave up and tried:
heroku container:release web -a app
! You do not have access to the app app.
which makes sense because I think you suppose to suppose to state the application name in heroku. However I am so lost as to what to do.
I have pushed a folder to heroku before using heroku cli, but I am trying to learn how to push a docker image.

I figured out my own issue again.
The answer is that I needed to set a git remote on the specific app in question.
heroku git:remote -a your_app_name
after doing this, I tried
heroku container:push web
then
heroku container:release and that worked

Related

Pushing Changes to Existing Heroku Registry

I created a web app and hosted it on Heroku a while ago. I basically wrote a dockerfile with all the instructions and followed steps like here. I just now opened my old laptop and made changes to some of the code. I tried to follow the same steps as usual to push changes, but when I run heroku container:push web -a bluebird-teaching (the app is called bluebird-teaching), I get a strange error.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I made sure that I'm logged in on Heroku CLI and my app still runs. The name of the app on Heroku is indeed the same name I'm putting in the tag (not sure of that matters). I can't just do heroku create because that's going to create a whole new app. I would just like to push changes to an existing app. Any ideas how I could do what I'm trying to do?
Thanks for any help.
Docker is not running on your old laptop.
The heroku container:push builds and pushes the image as defined in the Dockerfile: this needs the Docker deamon to run.

Getting error while deploying keycloak docker image to Heroku

I am pretty new to Heroku.
I am trying to deploy a keycloak docker image to heroku. I am getting this error while building the keycloak docker image.
! No default language could be detected for this app.
HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
See https://devcenter.heroku.com/articles/buildpacks
! Push failed
Any idea why is this happening ?
What is the build pack i need to select ?
My docker file looks like this
COPY docker-entrypoint.sh /opt/jboss/tools
ENTRYPOINT [ "/opt/jboss/tools/docker-entrypoint.sh" ]
CMD ["-b", "0.0.0.0"]```
Please see this: Github keycloak-heroku.
You can deploy using the deploy button from heroku or you can build and push your own image from the latest keycloak version. In my experience, you should use a dyno with at least 1 Gb ram for keycloak 11.

Failure to push Docker Image to Heroku Repository due to 'unauthorized access' error

I am trying to push a Docker image to the Heroku repository (web process), but am getting an authorisation issue (in trying to connect to the Heroku repo). Am new to this area, so appreciate any guidance on how to resolve this matter. Below is a screen grab which shows the error at the bottom. To start, it shows that I have successfully built the Docker image and tagged it to heroku. The directory I am running this in, and where the Dockerfile etc is stored is 'quote-app'. Appreciate any help on this please -
Successfully built 74d28e1cf94a
Successfully tagged registry.heroku.com/quote-app/web:latest
jito76#jito76-VirtualBox:~/quote-app$ docker push registry.heroku.com/quote-app/web
The push refers to repository [registry.heroku.com/quote-app/web]
3dc73b143d23: Preparing
2c8df0ddcfaf: Preparing
c73fe40e801c: Preparing
6e9ea2b471fc: Preparing
485a88bfb7a0: Preparing
11b5066d94a5: Waiting
bd8e6688d36c: Waiting
07cab4339852: Waiting
unauthorized: authentication required
jito76#jito76-VirtualBox:~/quote-app$
Thanks for the suggestions peeps. I did login using the 'heroku container:login' command, and it stated that I had "logged in successfully" when I ran the command. I am running the docker commands from the Ubuntu directory, that the container/app is stored in, instead of running it from home or as 'root' user. Hence, Am wondering whether I have the right Linux user rights to execute the code from there. Otherwise, am out of ideas for now
I was doing trial and error and this sorted out the auth issue, not sure what exactly did the magic:
heroku login
heroku stack:set container -a
heroku container:push worker -a
heroku container:login
heroku container:push worker -a
Remember to enter your Heroku App name after -a.
The application name quote-app does not match the Heroku application name: this happens when creating the Heroku app from the command line (heroku create without additional parameters)
It is better to set the application name explicitly
$ heroku create quote-app
$ docker build -t registry.heroku.com/quote-app/web .
$ docker push registry.heroku.com/quote-app/web
$ heroku container:release web -a quote-app

Link to Heroku Registry to pull the latest Docker image and use it as base image to prevent the release process from rebuilding it from the scratch

I'm working to deploy a project to Heroku using the container registry, but right now, it seems that Heroku rebuilds from scratch which is a time-wasting.
So, after studying, I found these related posts:
https://stackoverflow.com/a/58204409/3944086
Can I use Heroku registry as a base image for review app service?
I created a Dockerfile.heroku with this code:
FROM registry.heroku.com/app_name/image_name:latest
and modified heroku.yml as follow:
build:
docker:
web: Dockerfile.heroku
But when I pushed it to Heroku I got this error from Heroku build log:
=== Fetching app code
=== Building release (Dockerfile.heroku)
Sending build context to Docker daemon 168.4kBStep 1/1 : FROM registry.heroku.com/app_name/web:latest
Get https://registry.heroku.com/v2/app_name/web/manifests/latest: no basic auth credentials
Locally, I've logged in Heroku registry and I can pull the image.
How can I fix this issue?

heroku container:push not update new docker image

i am using heroku container:push web to deploy new image to heroku registry for my app. i tested my updated image on local docker, it working. But when re-deploy app with that command, it not working. Still old app state (with old code) exist, new image ignored.
So, heroku cache my app image? how can i delete cache?
Heroku changed the behavior of container:push a few days ago: https://devcenter.heroku.com/changelog-items/1426

Resources