Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 在jenkins中推送标记图像_Docker_Jenkins - Fatal编程技术网

Docker 在jenkins中推送标记图像

Docker 在jenkins中推送标记图像,docker,jenkins,Docker,Jenkins,我有一个jenkins代码示例,如下所示: node { def app stage('Clone repository') { /* Let's make sure we have the repository cloned to our workspace */ checkout scm } stage('Build and Push image') { docker.withRegistry('https:

我有一个jenkins代码示例,如下所示:

node {
    def app

    stage('Clone repository') {
        /* Let's make sure we have the repository cloned to our workspace */
        checkout scm
    }

    stage('Build and Push image') {
        docker.withRegistry('https://container-registry.oracle.com', 'container-hub-credentials') {
            sh """
                echo `pwd`

            """
        }


        docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
            sh """
                echo `pwd`
                docker build --build-arg ADMIN_PASS=weblogic123 --build-arg ADMIN_USER=weblogic -t wls-12213-domain .
                docker build -t leexha/wls-12213-oow-demo-domain  -f Dockerfile.adddemoapps .
                docker build -t leexha/oow-demo-webhook -f Dockerfile.webhook .
                docker push leexha/wls-12213-oow-demo-domain
                docker push leexha/oow-demo-webhook


            """
        }
    }
}
但它一直告诉我

denied: requested access to the resource is denied
当我试着推的时候


我已经在docker hub中创建了我的回购协议。那么,问题出在哪里呢?

我相信问题出在您在docker注册表凭据中使用的docker hub用户的访问权限上

Validiate当您作为docker hub用户登录时,您不能推送docker

docker登录-u用户名-p密码

docker推送图像名称


如果成功,请验证Jenkins用户可以使用docker套接字。

以便我可以作为sudo su-Jenkins bin/bash访问。然后我推了一下,它通过了。那么我如何验证jenkins用户可以使用socket事实上,在我的docker文件中,我正在做一个docker pull,它能够通过docker.hub.io进行拉取和构建。我就是不能说事实上,bash-4.2美元jenkins docker