我正在尝试使用管道来运行一些东西,当我开始运行我的管道时,它无法登录到docker。
奇怪的是,我可以登录到机器本身,但当我运行管道时,is失败了,出现了这个奇怪的错误:
Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] stage
[Pipeline] { (Front-end)
[Pipeline] node
Running on test-env in /var/www/test-env/workspace/client-e2e
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withDockerRegistry
Using the existing docker config file.Removing blacklisted property: auths$ docker login -u ***** -p ******** https://hub.docker.com/?namespace=******
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: login attempt to https://hub.docker.com/v2/ failed with status: 404 Not Found
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
ERROR: docker login failed
Finished: FAILURE我不知道为什么它要执行登录,而这个图像对每个人都是公开的。有人能帮帮我吗?
这是管道本身:
pipeline {
agent none
stages {
stage('Front-end') {
agent {
docker {
image 'node:8-alpine'
label "test-env"
}
}
steps {
sh 'node --version'
}
}
}
}发布于 2020-04-27 23:04:13
好的,过了一段时间,我发现它就像做这个一样简单
pipeline {
agent none
stages {
stage('Front-end') {
agent {
docker {
image 'node:8-alpine'
registryUrl 'https://index.docker.io/v1/'
label "test-env"
}
}
steps {
sh 'node --version'
}
}
}
}这是aded:registryUrl 'https://index.docker.io/v1/'
发布于 2020-04-27 23:02:11
您可以在以下位置尝试使用Credentials Binding Plugin:
steps { sh 'node --version' }
您可以执行以下操作:
withCredentials([string(credentialsId: 'mytoken', variable: 'TOKEN')]) {
sh '''
docker login -u '<your_user>' -p '<$TOKEN>'
node --version
'''}
https://stackoverflow.com/questions/61461577
复制相似问题