[JIRA] (JENKINS-38452) imageName() drops registry prefix outside of withRegistry() block

2018-02-23 Thread sahno...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mikhail Sakhnov edited a comment on  JENKINS-38452  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: imageName() drops registry prefix outside of withRegistry() block
 

  
 
 
 
 

 
 [~abayer] proof me if I am wrong, but to me, it seems that there is no way to use an image from private registry now. Let me explain what I mean.img.pull command always uses $\{imageName()} method (./main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy:141) to build image name (so, inside withRegistry it would be with registry prefix, outside it would be without registry prefix)but img.withRun command instead of imageName uses directrly id property: {code:java}def container = docker.script.sh(script: "docker run -d${args != '' ? ' ' + args : ''} ${id}${command != '' ? ' ' + command : ''}", returnStdout: true).trim(){code}so if we pull some image inside some withRegistry block, it will save the image with the full qualified local name. But even if we call withRun inside the same withRegistry block, it would use the not full qualified name, but id property passed to image constructor.Pseudocode:{code}docker.withRegistry("someregistry") {def image = docker.image("blablaimage")image.pull() // image saved to local docker with fq name image.run() // tries to run blablaimage which doesn't exists because on previous step it was saved with fq name} {code}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit 

[JIRA] (JENKINS-38452) imageName() drops registry prefix outside of withRegistry() block

2018-02-23 Thread sahno...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mikhail Sakhnov commented on  JENKINS-38452  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: imageName() drops registry prefix outside of withRegistry() block
 

  
 
 
 
 

 
 Andrew Bayer proof me if I am wrong, but to me, it seems that there is no way to use an image from private registry now. Let me explain what I mean. img.pull command always uses ${imageName()} method (./main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy:141) to build image name (so, inside withRegistry it would be with registry prefix, outside it would be without registry prefix) but img.withRun command instead of imageName uses directrly id property:  

 


def container = docker.script.sh(script: "docker run -d${args != '' ? ' ' + args : ''} ${id}${command != '' ? ' ' + command : ''}", returnStdout: 
true).trim()
 

 so if we pull some image inside some withRegistry block, it will save the image with the full qualified local name. But even if we call withRun inside the same withRegistry block, it would use the not full qualified name, but id property passed to image constructor. Pseudocode: 

 
 

 docker.withRegistry("someregistry")  { def image = docker.image("blablaimage") image.pull() // image saved to local docker with fq name image.run() // tries to run blablaimage which doesn't exists because on previous step it was saved with fq name }  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
 

[JIRA] (JENKINS-38452) imageName() drops registry prefix outside of withRegistry() block

2018-02-22 Thread sahno...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Mikhail Sakhnov commented on  JENKINS-38452  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: imageName() drops registry prefix outside of withRegistry() block
 

  
 
 
 
 

 
 Christian Höltje but for me, it looks like it doesn't work even if you defy img inside withRegistry block - withRun still ignores the registry prefix in the name.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.