buildx call failed with: error: denied: requested access to the resource is denied
Hi, I am trying to build and push a container to dockerhub as following
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: devopsdockeruh/coursepage:latest
Unfortunately I am getting error "buildx call failed with: error: denied: requested access to the resource is denied". Am I doing wrong?
@Recedivies Would need link to your repo and/or Dockerfile and complete logs of the workflow build step.
@crazy-max here's the link my repo https://github.com/Recedivies/deploy-docker
@Recedivies Looks like secrets.DOCKERHUB_USERNAME is not allowed to push to devopsdockeruh/coursepage. Check secrets.DOCKERHUB_TOKEN token is allowed to write to this repo in https://hub.docker.com/settings/security and also maybe a typo in devopsdockeruh/coursepage.
@crazy-max I have set the token's scope to "Read & Write". So, how do i achieve that then?
is there a solution to this? i have also encountered this problem.
@Recedivies @ArnonAsquira Does it work locally on your machine when you log in with those credentials and push to Docker Hub?
@crazy-max It worked after I changed the name of the image using docker tag. This change also made the Github action work. This very might be relevant to the publisher of the post.
@crazy-max @ArnonAsquira me either. It worked to me after i changed the name of image.
In my case, the name of image was correct, but I had a similar problem. Turned out I've already had one private repository on Docker Hub, so I couldn't create another one. So deleting all private repositories solved my problem.
This happened to me also when I started tagging the container images...
Someone knows how to solve that?
Are you guys prefixing your userspace/image:taghash with the correct hostname?
Mine was fixed by prefixing ghcr.io/ to the image name.
Looks like if you set tags then they need to have ghcr.io/ or ${{ env.REGISTRY }}/ otherwise it defaults to docker.io
It's because you are not supposed to push the docker image with the following tag tags: devopsdockeruh/coursepage:latest devopsdockeruh should be replaced by your own username.
I get the same error, I wanna push to a private rep of a organization that my account is in. Anyone had this before?
Label your tags this way for dockerhub
tags: ${{ secrets.DOCKER_USERNAME }}/my-own-tag:1.0
To add on to the solution by @zikozee It worked for me with :
tags: ${{ secrets.DOCKERHUB_USERNAME }}/test:1.0