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

docker.run within a withRegistry block seems to use image.id instead of image.imageName()

XMLWordPrintable

      Same issue as JENKINS-34276

      but with run command.

      Jenkins ver. 2.46.1
      docker-workflow ver. 1.10.0

      I'm trying to execute a mysql container container (docker-all.registry.com/group/mysql:1.1.0):

      node('docker') {
           docker.withRegistry('docker-all.registry.com', 'docker-registry-login') {
              def mysql = docker.image("group/mysql:1.1.0")
              
              mysql.pull()
              mysqlContainer = mysql.run()
           }
      }
      

      It goes well until the pull, which uses the imageName (docker-all.registry.com/group/mysql:1.1.0) but the run command uses id (group/mysql:1.1.0)

      Abbreviated logs:

      docker pull docker-all.registry.com/group/mysql:1.1.0
      1.1.0: Pulling from group/mysql
      Digest: sha256:7ae17175553a57e3d9ae594745e0ea13e0fc025dee3ad957df2d6ad1b5cb1342
      Status: Image is up to date for docker-all.registry.com/group/mysql:1.1.0
      [Pipeline] sh
      [ager-Branch_SCR-505372-SCSS-RXII4SDT2AVJPSV6GFXFSPPDAHPZCGARWKDM6ZHFOFUTVSQ4OJ4Q] Running shell script
      + docker run -d group/mysql:1.1.0
      Unable to find image 'group/mysql:1.1.0' locally
      docker: Error response from daemon: repository group/mysql not found: does not exist or no pull access.
      See 'docker run --help'.
      Finished: FAILURE
      

            jglick Jesse Glick
            arty13 Art V
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: