Docker login get failed with nexus repository - docker

We use the nexus repository manager (oss 3.22.1.-02 ) and for the first time, we are trying to setup a Docker repository with nexus. When we trying to execute docker login we are getting this error message.
Error:
error logging in to v2 end point trying next end point <url> failed with status 404 Not found
How we can fix this issue. we use Docker (18.09) version with this test

By configuring the /etc/docker/daemon.json file I was able to resolve this issue.
{
"insecure-registries": [<nexus hostname>:<port>],
"disable-legacy-registry": true
}

Related

Jenkins NPM private registry returns 401

Locally, I am able to successfully authorize and pull modules from my private Nexus registry (.npmrc file).
However on Jenkins I get
error An unexpected error occurred: "https://myprivaterepo.com/myprivatemodule.tgz: Request failed \"401 Unauthorized\"".
When I run npm whoami on Jenkins it returns a valid user. npm config ls prints valid configuration as well.
The problem started to occur when I changed myprivaterepo url (we've migrated it). Is there something I don't know (ie. I have to logout/login again or there's some cache in Jenkins)??
Thanks in advance!

Why jib dockerBuild plugin fails to connect

I was trying to build the docker image for a project I'm working onto.
It's based on jhipster, after configuring the project it tells me to run the following maven command:
./mvnw -ntp -Pprod verify jib:dockerBuild
Unfortunately it doesn't seem to work, it returns me this errors:
[WARNING] The credential helper (docker-credential-pass) has nothing for server URL: registry.hub.docker.com
...
[WARNING] The credential helper (docker-credential-pass) has nothing for server URL: index.docker.io
[WARNING]
And finally fails with:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.4.0:dockerBuild (default-cli) on project booking: (null exception message): NullPointerException -> [Help 1]
Recently I worked on a google cloud project, and I edited the ~/.docker/config.json configuration file. I had to remove google's configuration entries to sort out another problem. Could that be the origin of the problem I'm facing now?
I've tried to do docker logout and docker login without success.
Some considerations
I don't know if editing manually the configuration caused the error, in fact I'm pretty sure to have deleted only google-related entries, but nothing referring to docker.* or similar.
To solve this issue, avoid to edit manually the docker configuration file. In fact I think that it should be avoided whenever possible, to avoid configuration problems of any sort.
Instead, just follow what the error message is trying to tell you: docker is not able to access those urls. Excluding network problems (which you can troubleshoot with ping registry-1.docker.io for example), it should be an authentication problem.
How to fix
I've found out that running those commands fixed it:
docker login registry.hub.docker.com
docker login registry-1.docker.io
I don't know if registry-1.docker.io is just a mirror of the other first server, which the plugin tries to access after the first unsuccessful connection. You can try to loging to registry.hub.docker.com and re-launch the command to see if it sufficient. In case it's not, login to the second one and then it will work.
I ran jib via Gradle:
./gradlew jibDockerBuild
and got a similar error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jibDockerBuild'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Build to Docker daemon failed, perhaps you should make sure your credentials for 'registry-1.docker.io/library/openjdk' 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
What ended up solving this error for me, bizarrely enough, was to log out of Docker Desktop.
I later also tried funder7's solution while logged in to Docker Desktop, and that also worked.

pull access denied for "aaaaa" repository does not exist or may require 'docker login'

After cloning a project from Gitlab on ubuntu, I tried to run it through docker, I opened a terminal, got to the directory where the .yml file was and wrote down:
I was greeted with this message:
The image for the service you're trying to recreate has been removed.
If you continue, volume data could be lost. Consider backing up your
data before continuing.
Continue with the new image?
I pressed y.
Then for a few seconds, I got:
Pulling "name of the module here"
Then I was greeted with this message:
ERROR: pull access denied for "name of the module here", the repository does not exist or may require 'docker login'
pedroesteves#pedro:~/Desktop/project$
Any help would be very appreciated. I already looked to some similar posts but none was able to help me.
You can pull image from a private registry, but You will get an error on the new version of Docker related to certificated, during pull image on the client side.
First, you to modify docker daemon file on the client side
create the file if not exist
/etc/docker/daemon.json
Add the following
{ "insecure-registries":["gitlab.my-site.com:5000"] }
Then you are good to go
docker login gitlab.my-site.com:5000

Error response from daemon: Get https://xxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com/v2/xxxx/manifests/v_50: no basic auth credentials

I'm trying to implement CD/CI workflow with jenkins-docker-aws. I'm in the point of having the job properly configured but I'm getting an error at deployment time in ec2.
I face in AWS the following error:
Status reason CannotPullContainerError: API error (404): repository xxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com/xxxxxxxxx not found
My repository exists in AWS ECR. So, debugging and trying to pull the image that is in the Repository, I've executed the following commands to confirm everything is fine:
1.- Getting Logging succeeded by executing the output of:
aws ecr get-login --no-include-email
2.- Checked my ~/.docker/config.json it shows, firstly it showed registry URL without protocol, but after reading some recomendations pointed to add it:
{
"auths": {
"https://xxxxxxxx.dkr.ecr.us-west-1.amazonaws.com": {
"auth": "long key..."
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/17.12.1-ce (linux)"
}
}
So, after these checks and execute the pull command, I'm still getting...
[ec2-user#ip-xxxxxx .docker]$ docker pull xxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com/xxxxxxxxx:v_50
Error response from daemon: Get https://xxxxxxxxx.dkr.ecr.us-east-2.amazonaws.com/v2/davidtest/manifests/v_50: no basic auth credentials

Manifest peer latest not found error during hyperledger installation.

I have just started exploring the blockchain technology. I was working around the installation part by following this tutorial.
I have created /mychain directory and docker-compose.yml. when i run the command sudo docker-compose up it starts pulling member services hyperledger/fabric-membersrvc. But after that it throws error
Pulling vp0 (hyperledger/fabric-peer:latest)...
ERROR: manifest for hyperledger/fabric-peer:latest not found
Please someone guide me on this.
Change the tag from latest to x86_64-1.0.2 in the compose file. There is no latest tag for this image. You can get all available tags on below link
https://hub.docker.com/r/hyperledger/fabric-peer/tags/
If you don't add any tags to fabric-peer, docker try to pull image with latest tag. And there is no latest tag for fabric-peer.
So you should use an available tag, see available tags here.
I had the similar issue, the problem was fabric failed to download peer binary with tag '2.2.1' and 'latest' during 'curl' command execution with following error.
Peer image getch failed:
====> hyperledger/fabric-peer:2.2.1
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout
Error response from daemon: No such image: hyperledger/fabric-peer:2.2.1
Error response from daemon: No such image: hyperledger/fabric-peer:2.2.1
Solution which worked for me:
Have downloaded peer 2.2.1 manually using below command
docker pull "hyperledger/fabric-peer:2.2.1"
NOTE:
"network.sh up" also throws error as it is trying to use peer binary of latest tag which is not present in docker hub. Since 2.2.1 was the latest I have created tag manually using below command.
docker image tag hyperledger/fabric-peer:2.2.1 hyperledger/fabric-peer:latest
Then it worked. You can use your version accordingly.
For HyperLedger 2.3, I found that the 'network.sh' file needs to be edited.
This file can be found under 'fabric-samples/test-network' directory.
Find the constant 'IMAGETAG' and replace its value "latest" into "2.3" or whatever your peer version is.
This constant will be referenced in all the docker-compose files.

Resources