Using cibuildwheel on a Gitlab instance behind a corporate proxy #1663
Replies: 3 comments 1 reply
-
I have a similar issue and have not found a solution yet. clearly I cannot access the host via 127.0.0.1 within the docker container, so I tried "host.docker.internal" but it does not work. I guess it's because the "NAT" does not work well with proxydetox listening only on 127.0.0.1. Not sure if using host networking would work, but there is no option in cibuildwheel to pass to docker run (just create) Any Ideas on how to solve that? PS: yes I know that injecting the credentials in clear text in an environment variable and using the real proxy IP works but it's not the intention... |
Beta Was this translation helpful? Give feedback.
-
I'm not sure. It's just a wild idea, don't know if it makes sense, but if you create a Dockerfile that installs proxydetox and run this image as an extra service, maybe you can get the cibuildwheel container to communicate though that proxydetox container. I'm not familiar with it, but I read that with Docker swarm it is possible to use so-called "secrets" to safely inject credentials in containers. Maybe at some point an issue should be opened with the maintainers of cibuildwheel to see what they can suggest for users behind a proxy. Maybe they can provide official recommendations on how to proceed. |
Beta Was this translation helpful? Give feedback.
-
It seems you can change the interface proxydetox listens to. |
Beta Was this translation helpful? Give feedback.
-
I am writing this to document how I could use cibuildwheel behind a corporate proxy (at least in Gitlab).
I couldn't find any information in the docs about this, nor in the Github issues or discussions.
Initially, I would get an HTTP 504 error (that was from my proxy). As I progressed with configuring this, I also got HTTP 502, and pip errors basically saying pip couldn't find packages.
Anyway, what I found is that I need to define the proxy environment variables and make sure they are passed to the container doing the build.
In particular,
NO_PROXY
must containdocker
for the python container to be able to reach the dind container.Also, I needed to implement docker-specific proxy configuration in
.docker/config.json
. I usedCIBW_BEFORE_ALL
for this.Beta Was this translation helpful? Give feedback.
All reactions