Pip not able to run inside container if using extra index

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pip not able to run inside container if using extra index

barrett-2
The following does not work while running inside a container from a scripted Jenkinsfile.  The operation simply hangs (or at least I should say I haven't waited long enough for it to timeout.)

docker.image("container.jfrog.io/build-images/python:11.4.2").inside() {

                  sh(" pip install -r requirements.txt --extra-index-url https://[hidden email]/company/api/pypi/python/simple")

}

If I remove the extra-index-url then the operation completes. What is interesting is the first listing in my requirements.txt is not an artifact in my own private repo, but rather one in pypi. 

Running the command from the same image locally works, without issue.



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ca8cd028-8351-4e40-9bd6-526731835220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Pip not able to run inside container if using extra index

Björn Pedersen
Hi,

there are two things to consider:

1) does the jenkins host allow access to  outside services?
2) Jenkins will run things in the container as user 'jenkins', not as root, which is the default if you are using "docker run".
    If you did not omit the virtualenv actviation for brevity here, pip will probably fail.

Am Mittwoch, 6. Dezember 2017 03:53:24 UTC+1 schrieb [hidden email]:
The following does not work while running inside a container from a scripted Jenkinsfile.  The operation simply hangs (or at least I should say I haven't waited long enough for it to timeout.)

docker.image("<a href="http://container.jfrog.io/build-images/python:11.4.2" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcontainer.jfrog.io%2Fbuild-images%2Fpython%3A11.4.2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEExZUeNJsKyAozaD3p7-gjinOteA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcontainer.jfrog.io%2Fbuild-images%2Fpython%3A11.4.2\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEExZUeNJsKyAozaD3p7-gjinOteA&#39;;return true;">container.jfrog.io/build-images/python:11.4.2").inside() {

                  sh(" pip install -r requirements.txt --extra-index-url <a href="https://scrubbed@company.jfrog.io/company/api/pypi/python/simple" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fscrubbed%40company.jfrog.io%2Fcompany%2Fapi%2Fpypi%2Fpython%2Fsimple\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGM8t3kt4_vPpZAjejJWt_4XqJFcg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fscrubbed%40company.jfrog.io%2Fcompany%2Fapi%2Fpypi%2Fpython%2Fsimple\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGM8t3kt4_vPpZAjejJWt_4XqJFcg&#39;;return true;">https://scrubbed@company.jfrog.io/company/api/pypi/python/simple")

}

If I remove the extra-index-url then the operation completes. What is interesting is the first listing in my requirements.txt is not an artifact in my own private repo, but rather one in pypi. 

Running the command from the same image locally works, without issue.



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a5c94eaf-23f1-4810-b174-b85b8c50838d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.