Cannot pull nginx. Unauthorized for registry-1.docker.io/library/nginx: 401 Unauthorized
See original GitHub issueEnvironment:
- *Jib version: 1.6.1
- *Build tool: Maven
- *OS: CentOS (Building maven on Jenkins)
Description of the issue:
Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.6.1:build (default-cli) on project remoteportal.client: Build image failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/nginx' 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/nginx: 401 Unauthorized
Expected behavior: It should pull the public image without needing authorisation.
Steps to reproduce:
- I’m running this on a centOS instance with Jenkins pipeline.
- It works on local (Docker for Mac)
- It worked for me a week back, because I have an image of this app in ECR.
jib-maven-plugin
Configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>nginx</image>
</from>
<to>
<image>${ecrEndpoint}/frontend-${docker-artifact-id}</image>
<tags>
<tag>${project.version}</tag>
</tags>
</to>
<container>
<ports>
<port>80</port>
<port>443</port>
</ports>
<entrypoint>
<command>nginx</command>
<arg>-g</arg>
<arg>daemon off;</arg>
</entrypoint>
</container>
<extraDirectories>
<paths>${project.build.directory}/it-temp/frontend-dist/</paths>
</extraDirectories>
<skip>false</skip>
</configuration>
</plugin>
Log output:
Additional Information:
I’m running the mvn jib:build
in the Jenkins pipeline.
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Docker login 401 Unauthorized, external registry - GitLab Forum
I can't get docker login to work correctly with gitlab and a registry using docker-compose. When I log in with a wrong password...
Read more >Kubernetes ImagePullBackOff: Troubleshooting With Examples
One such error is ImagePullBackOff. It typically shows up when the kubelet agent instructs the container runtime and can't pull the image from...
Read more >docker unauthorized: authentication required - upon push with ...
I found out out that even if I login successfully with the docker login command, any pull failed. I tried to clean up...
Read more >Failed with status: 401 Unauthorized - DockerEngine
Hi, I am getting the following error on the logs when trying to run/pull hello-world msg="Handler for POST /v1.23/containers/create returned ...
Read more >ERROR [internal] load metadata for docker.io - You.com
failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: failed to fetch oauth token: unexpected status: 401...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chanseokoh Yeah, it was a mistake from our end. The picked up credentials were wrong. We had thought there are no credentials on the server, but somehow there were some present. It’s working fine without any credentials.
I understand, but I think we’re good with trying to be automatic. This is also similar to how the Docker CLI works. Actually, it is only this issue that is potentially affected, but even so, it is not confirmed yet. Others were due to different reasons. And we have opened #2056, so once that is fixed, this will become clear.
But if we see more people wanting to explicitly disable using any credentials, we could potentially introduce a flag like
doNotUseAnyCredentials
. However, it doesn’t look like people will use such a flag a lot, but we’ll see.