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

Docker Commons/Pipeline upgrade breaks build jobs

XMLWordPrintable

      Two days ago, we upgraded docker-commons from 1.11 to 1.12 and docker-workflow from 1.15.1 to 1.16 - and our jobs stopped working. Reverting the two plugins makes jobs build again.

      The setup is a bit complicated: The Jenkins master is running on a Debian Stretch machine, but the build nodes are running on the same machine as Docker containers using the plugin simply named Docker.

      As the Docker daemon is running outside the Docker container with the build node, I use a construct like the following to handle Docker commands:

      withEnv(["DOCKER_HOST=$\{DOCKER_HOST}"]) {
        docker.withRegistry("https://${DOCKER_REPO}", 'artifactory-api-key') {
          dockerImage.push("${currentBuild.number}")
          dockerImage.push('latest')
        }
      }

      This has worked fine for a long time, but with the above mentioned upgrade, it started failing with error messages like

      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] withDockerRegistry$ docker login -u jenkins -p ******** https://${DOCKER_REPO}
      WARNING! Using --password via the CLI is insecure. Use --password-stdin.
      Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: 
       https://index.docker.io/v1/
      Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
      [Pipeline] // withDockerRegistry
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      

      Reverting the two plugins to the previous versions solves the problem.

      Regards,
      Lars

            Unassigned Unassigned
            larsskj Lars Skjærlund
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: