denied: requested access to the resource denied

33 Views Asked by At

[denied access(https://i.stack.imgur.com/Sr1VT.png)

When I create a job in Jenkins, the first step is to clone the code from GitHub. Then, I build a Docker image using the Dockerfile and attempt to push the Docker image to Docker Hub. However, an error occurs: "problems denied: requested access to the resource is denied." When I try to solve this problem by logging into Docker and pushing the image again, it still shows the error: "denied: requested access to the resource is denied, unauthorized: authentication required.

1

There are 1 best solutions below

0
Stanley Sathler On
  1. First, make sure you're logged in.
$ docker login -u your-username

Use, for the password, either your password or one of your Access Tokens (prefered).

  1. Make sure you have your Docker Hub username in your image name. Example:
$ docker build -t your-username/your-image -f ./Dockerfile .