Jenkins docker push to harbor private service error solution
Jenkins reported an error
When using docker push to private service in jenkinsfile, an error is reported. The error information is as follows:
unauthorized: unauthorized to access repository: ocp/eureka-server, action: push: unauthorized to access repository: ocp/eureka-server, action: push
This is because Jenkins uses the pseudo user of Jenkins when pushing the image. Since you need to log in to push, you should first generate config.json in the current user
The current user uses docker login to generate config.json
The current user logs in with the following command
docker login ip:port
After entering the user name and you, a config.json file is generated in the. Docker directory of the current user’s root directory, as follows:
[wangxianfeng@hs ~]$ cat /root/.docker/config.json
{
"auths": {
"harbor.aiuyo.com:643": {
"auth": "d2FuZ3hpYW5mZW5nOlhpYW5mZW5nOTk="
}
}
}
Copy. Docker to/var/lib/Jenkins directory
- after logging in with root, copy the/user name /. Docker/directory to/var/lib/Jenkins, and modify the folder permission chown – R Jenkins. Jenkins. Docker OL> to/var/lib/Jenkins
cp -r /root/.docker/ /var/lib/jenkins/
cd /var/lib/jenkins/
chown -R jenkins.jenkins .docker
I am for this reason. After modification, it can be pushed
Read More:
- Troubleshooting of Jenkins upgrade to 2.42 JUnit test report
- Jenkins series installation and deployment in docker mode
- git push error failed to push some refs to solution
- Modify the tomcat configuration in docker, causing javaagent to report agent library failed to init instrument
- GitHub upload failed: git push error: failed to push some refs to exception handling
- Error report after solving git push origin master
- How to Fix ERROR: Couldn’t connect to Docker daemon at http+docker://localhost – is it running?
- [Sovled] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
- Solution to a Jenkins serious error recorded by automation platform
- Docker was unable to connect to the docker daemons
- Error response from daemon for private harbor login
- Error: failed to push some refs to ‘xxx’
- error: src refspec master does not match anyerror: failed to push some refs to
- Solve github :error: failed to push some refs to problem
- Docker start error: failed to start docker application container engine.
- GitLab You are not allowed to push code to this project
- Error: SRC refspec master does not match any. error: failed to push some refs to
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- Android studio push project to GitHub
- The solution of push D command execution error (/ bin / sh: 1: push D: not found) on Ubuntu