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

pipeline docker agent configuration is inconsistent

    • Declarative backlog

      I was having issues with configuring a docker agent in a declarative pipeline project, which I tracked down to an inconsistency with the way the configuration parameters are handled while pulling and running the image.

       

      Given a configuration that includes this:

        agent {
          docker {
            registryUrl "https://my-project.nexus.mydomain.com"
            registryCredentialsId "myproject-registry-creds"
            image "myproject/build:latest"
          }
        }
      

      I would expect to happen given this configuration would be something like this:

      docker pull my-project.nexus.mydomain.com/myproject/build:latest
      docker run ... my-project.nexus.mydomain.com/myproject/build:latest
      

      What actually happens though, is this:

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      docker pull my-project.nexus.mydomain.com/myproject/build:latest
      docker run ... myproject/build:latest
      

      This means that even though the console logs showed the correct image being pulled, a different image was actually run.

          [JENKINS-49280] pipeline docker agent configuration is inconsistent

          Hi jasonk, could you post more logs about this issue and more information about your pipeline? In my tests all the executions are in order.

           Also, could you test it with (and without it) this config option:

          docker {
           alwaysPull true
           registryUrl "****"
           registryCredentialsId "****"
           image "*****"
          }
          

           

           

          Jose Blas Camacho Taboada added a comment - Hi  jasonk , could you post more logs about this issue and more information about your pipeline? In my tests all the executions are in order.  Also, could you test it with (and without it) this config option: docker { alwaysPull true registryUrl "****" registryCredentialsId "****" image "*****" }    

            Unassigned Unassigned
            jasonk Jason Kohles
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: