Error happened while using Jenkins to push docker image - docker

I'd like to push the image image/name to the docker repository image/name through Jenkins. I have logged in my docker account on my local machine. But it returned with the error:
com.github.dockerjava.api.exception.DockerClientException: Could not push image: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
why?

Maybe use the library you are building with to pass credentials
From the doc:
.withRegistryUsername(registryUser)
.withRegistryPassword(registryPass)
Reference: https://github.com/docker-java/docker-java/blob/master/docs/getting_started.md
I'm assuming this is the library you use by the error message you posted.

Related

How do you add a private registry to docker?

I'm new to Docker. I have installed Docker version : 20.10.15 and am trying to download images from one of our vendor sites.
While I was able to download images earlier, now I get the below error :
----------------------------------------------------------------------------------
cmd : **docker pull containers.XXX.com/bmc/lpade:kubectl-latest**
Error response from daemon: Head "https://containers.XXX.com/v2/bmc/lpade/manifests/kubectl-latest": unauthorized: unable to get identity token from basic auth credentials: invalid grant: invalid authentication credentials given
----------------------------------------------------------------------------------
May I know what is causing this error? Also I would like to know how this repo was working earlier , (as this is not a docker hub repo) how does docker knows that there is a private registry?

cant pull image from own private docker repo

I can't seem to pull from my own private repo on dockerhub. I successfully pushed the image to dockerhub (using macosx) and set it to private. I then tried to pull from another laptop (Windows 10) but I keep getting Error response from daemon: pull access denied for {username}/{repo}, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
I am using a command like, docker pull {username}/{reponame}:{tag}. The windows laptop is a work laptop and the macosx is the personal computer. Does it have to do something with a transparent proxy? I looked into this, control docker with systemd but I don't know how to set that up in Windows; the article instructs for a unix based system it seems.
I also tried adding the registry name (based on other stackoverflow posts) in the front like, docker pull hub.docker.com/{username}/{reponame}:{tag} but that gives me another error:
Error response from daemon: error parsing HTTP 408 response body: invalid character '<' ...
I ensured I am logged in:
docker login
Authenticating with existing credentials...
Login Succeeded
Any help or guidance would be appreciated. Thanks.

Error while pushing image to docker. Requested access to the resource is denied

I am trying to push an image of my application to dockerhub but i keep getting this error:
requested access to the resource is denied.
I am already logged in with my credentials using docker login. My repository is public. I have tried everything it keeps giving me this error.
docker login
docker tag springmysqldockerswagger:latest vai/spring:myfirstimagepush
docker push vai/spring:myfirstimagepush
Any help would be appreciated.

docker push failed. unauthorized: authentication required

I am having a visual studio subscription. From that I am having a benefit of accessing azure devops. I have used docker container registry for image build and push, and it is successful. Now I have changed to Azure container registry, this time image build is successful, but push failed saying unauthorized access. See below error
The push refers to repository [(registryname).azurecr.io/(myname)/myfirstproject]. unauthorized: authentication required
I have tried to select Service Principal Authentication option, but saying
**Failed to create an app in Azure Active Directory. Error: Insufficient privileges to complete the operation.**
So, I have used Managed Identity Authentication option, but the push image failed.
Is it like I have to use Service Principal Authentication option only to push the image in ACS or am I missing anything.
I can provide more information if required.
Thanks in advance.

docker push - access not authorized

I am trying to push an image to docker hub.
I created an account "kaffeekaethe" and created a public repository "reservierung".
I build the image "kaffeekaethe/reservierung" (no typos, I double checked that).
Afterwards I logged into docker hub and tried to push the image, but I am alwasy getting the error "access to the requested resource is not authorized". Everyone else who had this problem wasn't logged in prior to the push command, and that was the only solution that I've found. Is there any other reason for this error?

Resources