Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51397

docker login being called without server-related environment variables

    Details

    • Similar Issues:

      Description

      Split out from JENKINS-38018. The environment variables set by withDockerServer are not being passed to the docker login command.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue blocks JENKINS-38018 [ JENKINS-38018 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Page (Jenkins Wiki)" [ 20688 ]
            Hide
            nicolasus Nico Navarrete added a comment -

            This works with

            docker-plugin 1.1.4
            docker-workflow 1.15.1

             

            but not with

            docker-plugin 1.1.4
            docker-workflow 1.6

             

                // run from base dir for folder builds and from tmp for url builds
                dir ("$runPwd") {
                    echo "Build with server ${env.DOCKER_HOST} and registry ${env.CP_DOCKER_RELEASE}"
                    docker.withServer(env.DOCKER_HOST) {
                        docker.withRegistry(env.CP_DOCKER_RELEASE,env.DOCKER_CREDENTIALS ){
                            echo "Execute docker build -t $name:$version $params"
                            sh "docker   build -t $name:$version $params"
            //                def image = docker.build ("$name:$version", params)
                        }
                    }
                }
            
            Show
            nicolasus Nico Navarrete added a comment - This works with docker-plugin 1.1.4 docker-workflow 1.15.1   but not with docker-plugin 1.1.4 docker-workflow 1.6       // run from base dir for folder builds and from tmp for url builds     dir ( "$runPwd" ) {         echo "Build with server ${env.DOCKER_HOST} and registry ${env.CP_DOCKER_RELEASE}"         docker.withServer(env.DOCKER_HOST) {             docker.withRegistry(env.CP_DOCKER_RELEASE,env.DOCKER_CREDENTIALS ){                 echo "Execute docker build -t $name:$version $params"                 sh "docker   build -t $name:$version $params" //                def image = docker.build ( "$name:$version" , params)             }         }     }
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-commons PR 71 (Web Link)" [ 20689 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-workflow PR 140 (Web Link)" [ 20690 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            Hide
            jglick Jesse Glick added a comment -

            Nico Navarrete Scott Williams Hans Schulz et al., anyone care to test a proposed fix? If so, use the Advanced tab to manually update this build of docker-commons and of docker-workflow.

            Show
            jglick Jesse Glick added a comment - Nico Navarrete Scott Williams Hans Schulz et al., anyone care to test a proposed fix? If so, use the Advanced tab to manually update this build of docker-commons and of docker-workflow .
            Hide
            jglick Jesse Glick added a comment -

            BTW Nico Navarrete the version of the docker plugin is probably irrelevant here. docker-commons and docker-workflow are the plugins involved.

            Show
            jglick Jesse Glick added a comment - BTW Nico Navarrete the version of the docker plugin is probably irrelevant here. docker-commons and docker-workflow are the plugins involved.
            Hide
            jglick Jesse Glick added a comment -

            (The downloads above also include the fix for JENKINS-51395.)

            Show
            jglick Jesse Glick added a comment - (The downloads above also include the fix for JENKINS-51395 .)
            Hide
            schulzha Hans Schulz added a comment -

            Jesse Glick The fix works for us, thank you!

            Show
            schulzha Hans Schulz added a comment - Jesse Glick The fix works for us, thank you!
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryEndpoint.java
            src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryToken.java
            src/main/java/org/jenkinsci/plugins/docker/commons/impl/RegistryKeyMaterialFactory.java
            src/test/java/org/jenkinsci/plugins/docker/commons/util/SampleDockerBuilder.java
            http://jenkins-ci.org/commit/docker-commons-plugin/4f7f7772d36c277c0a055489d35bccaa3658890e
            Log:
            JENKINS-51397 Define API for passing environment to docker login command.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryEndpoint.java src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryToken.java src/main/java/org/jenkinsci/plugins/docker/commons/impl/RegistryKeyMaterialFactory.java src/test/java/org/jenkinsci/plugins/docker/commons/util/SampleDockerBuilder.java http://jenkins-ci.org/commit/docker-commons-plugin/4f7f7772d36c277c0a055489d35bccaa3658890e Log: JENKINS-51397 Define API for passing environment to docker login command.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryEndpoint.java
            src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryToken.java
            src/main/java/org/jenkinsci/plugins/docker/commons/impl/RegistryKeyMaterialFactory.java
            src/test/java/org/jenkinsci/plugins/docker/commons/util/SampleDockerBuilder.java
            http://jenkins-ci.org/commit/docker-commons-plugin/a5e6fa06a9d2f2419dc4e9cf1c07ff2886df5a5e
            Log:
            Merge pull request #71 from jglick/docker-login-env-JENKINS-51397

            JENKINS-51397 Define API for passing environment to docker login command

            Compare: https://github.com/jenkinsci/docker-commons-plugin/compare/5bd5ad32f534...a5e6fa06a9d2
            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryEndpoint.java src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryToken.java src/main/java/org/jenkinsci/plugins/docker/commons/impl/RegistryKeyMaterialFactory.java src/test/java/org/jenkinsci/plugins/docker/commons/util/SampleDockerBuilder.java http://jenkins-ci.org/commit/docker-commons-plugin/a5e6fa06a9d2f2419dc4e9cf1c07ff2886df5a5e Log: Merge pull request #71 from jglick/docker-login-env- JENKINS-51397 JENKINS-51397 Define API for passing environment to docker login command Compare: https://github.com/jenkinsci/docker-commons-plugin/compare/5bd5ad32f534...a5e6fa06a9d2 * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Page (Jenkins Wiki)" [ 20699 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/docker/workflow/RegistryEndpointStep.java
            http://jenkins-ci.org/commit/docker-workflow-plugin/2319da7e180d2c49d77f8572becb980573bdf241
            Log:
            JENKINS-51397 Pass environment to docker login command.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/docker/workflow/RegistryEndpointStep.java http://jenkins-ci.org/commit/docker-workflow-plugin/2319da7e180d2c49d77f8572becb980573bdf241 Log: JENKINS-51397 Pass environment to docker login command.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/docker/workflow/RegistryEndpointStep.java
            http://jenkins-ci.org/commit/docker-workflow-plugin/a19719c196def05b740b44b75376e25dda077b84
            Log:
            Merge pull request #140 from jglick/docker-login-env-JENKINS-51397

            JENKINS-51397 Pass environment to docker login command

            Compare: https://github.com/jenkinsci/docker-workflow-plugin/compare/e8a1815cf41b...a19719c196de
            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/docker/workflow/RegistryEndpointStep.java http://jenkins-ci.org/commit/docker-workflow-plugin/a19719c196def05b740b44b75376e25dda077b84 Log: Merge pull request #140 from jglick/docker-login-env- JENKINS-51397 JENKINS-51397 Pass environment to docker login command Compare: https://github.com/jenkinsci/docker-workflow-plugin/compare/e8a1815cf41b...a19719c196de * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: