0

I am using mvnw -Pprod verify jib:dockerBuild to build the docker image for my jHipster project and I am getting: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli)Build to Docker daemon failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/eclipse-temurin' are set up correctly. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized for help: Unauthorized for registry-1.docker.io/library/eclipse-temurin: 401 Unauthorized [ERROR] {"details":"incorrect username or password"} What actually need the authorization? Is it for pulling the eclipse-temurin? or is it pushing something to registry-1.docker.io?

Rithu
  • 79
  • 1
  • 6
  • It is a common misunderstanding that public images on Docker Hub (`temurin` in this case) don't requires authentication. You do need to authenticate. It is just that you can skip sending a username and a password for public images. Apparently, Jib was able to pick up some credentials on your machine and sent them to Docker Hub. Then, Docker Hub reports that the username and password given to the server are wrong (e.g., typo). Check the Jib log to figure out where it was able to pick up the username and password. Removing them will make it work. – Chanseok Oh Jun 01 '22 at 22:24
  • actually after giving the authentication like **docker login https://registry-1.docker.io** it worked. Sorry I am new to docker and not sure whether this registry-1.docker.io is a mirror hub or something. My credentials were correct only – Rithu Jun 02 '22 at 18:02
  • `registry-1.docker.io` is Docker Hub. Simply doing `docker login` would have the same effect as `docker login registry-1.docker.io`. Anyways, since you logged in successfully, now it should work fine. – Chanseok Oh Jun 02 '22 at 18:53
  • simply giving docker login didn't work in my case, after I logged in using **docker login registry-1.docker.io** only I was able to build. I could see 2 different entries in ~/.docker/config.json file – Rithu Jun 03 '22 at 00:40
  • I ran docker logout, removed the config.json and also signed out of Docker Desktop. Then did the login with Docker Destop and it started to work. Oddly config.json was not recreated so Docker Desktop probably put the secrets into macosxkeychain. – zolee Feb 21 '23 at 08:05

0 Answers0